diff options
-rw-r--r-- | docs/pango-sections.txt | 1 | ||||
-rw-r--r-- | pango/pango-layout.c | 20 | ||||
-rw-r--r-- | pango/pango-layout.h | 2 | ||||
-rw-r--r-- | pango/pango.def | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index d0236a24..d8f2c05e 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -442,6 +442,7 @@ pango_layout_context_changed pango_layout_set_text pango_layout_get_text +pango_layout_get_character_count pango_layout_set_markup pango_layout_set_markup_with_accel pango_layout_set_attributes diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 0b17ea87..5952fa85 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1096,6 +1096,26 @@ pango_layout_get_text (PangoLayout *layout) } /** + * pango_layout_get_character_count: + * @layout: a #PangoLayout + * + * Returns the number of Unicode characters in the + * the text of @layout. + * + * Return value: the number of Unicode characters + * in the text of @layout + * + * Since: 1.30 + */ +gint +pango_layout_get_character_count (PangoLayout *layout) +{ + g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); + + return layout->n_chars; +} + +/** * pango_layout_set_markup: * @layout: a #PangoLayout * @markup: marked-up text diff --git a/pango/pango-layout.h b/pango/pango-layout.h index 52dc36a8..39d2e701 100644 --- a/pango/pango-layout.h +++ b/pango/pango-layout.h @@ -103,6 +103,8 @@ void pango_layout_set_text (PangoLayout *layout, int length); const char *pango_layout_get_text (PangoLayout *layout); +gint pango_layout_get_character_count (PangoLayout *layout); + void pango_layout_set_markup (PangoLayout *layout, const char *markup, int length); diff --git a/pango/pango.def b/pango/pango.def index 70e1a50e..3e6a4281 100644 --- a/pango/pango.def +++ b/pango/pango.def @@ -233,6 +233,7 @@ EXPORTS pango_layout_get_attributes pango_layout_get_auto_dir pango_layout_get_baseline + pango_layout_get_character_count pango_layout_get_context pango_layout_get_cursor_pos pango_layout_get_ellipsize |