[librsvg] rsvg_state_get_language(): New accessor
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg_state_get_language(): New accessor
- Date: Fri, 15 Dec 2017 18:53:22 +0000 (UTC)
commit 2ec37a704a9001e4828559f846bc379916aa655b
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Dec 14 14:16:37 2017 -0600
rsvg_state_get_language(): New accessor
rsvg-styles.c | 6 ++++++
rsvg-styles.h | 4 ++++
rsvg-text.c | 6 ++++--
3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index 63f743a..a5a2065 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1768,3 +1768,9 @@ rsvg_state_get_current_color (RsvgState *state)
{
return state->current_color;
}
+
+const char *
+rsvg_state_get_language (RsvgState *state)
+{
+ return state->lang;
+}
diff --git a/rsvg-styles.h b/rsvg-styles.h
index d170b4d..a459f2d 100644
--- a/rsvg-styles.h
+++ b/rsvg-styles.h
@@ -253,6 +253,10 @@ RsvgOpacitySpec *rsvg_state_get_stop_opacity (RsvgState *state);
G_GNUC_INTERNAL
guint32 rsvg_state_get_current_color (RsvgState *state);
+G_GNUC_INTERNAL
+const char *rsvg_state_get_language (RsvgState *state);
+
+
G_END_DECLS
#endif /* RSVG_STYLES_H */
diff --git a/rsvg-text.c b/rsvg-text.c
index 61190cb..17bfe6a 100644
--- a/rsvg-text.c
+++ b/rsvg-text.c
@@ -559,13 +559,15 @@ rsvg_text_create_layout (RsvgDrawingCtx *ctx, const char *text)
PangoAttrList *attr_list;
PangoAttribute *attribute;
double dpi_y;
+ const char *lang;
state = rsvg_current_state (ctx);
context = rsvg_drawing_ctx_get_pango_context (ctx);
- if (state->lang)
- pango_context_set_language (context, pango_language_from_string (state->lang));
+ lang = rsvg_state_get_language (state);
+ if (lang)
+ pango_context_set_language (context, pango_language_from_string (lang));
if (state->unicode_bidi == UNICODE_BIDI_OVERRIDE || state->unicode_bidi == UNICODE_BIDI_EMBED)
pango_context_set_base_dir (context, state->text_dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]