From b5634799586ed8e3496ffc237b8d08e6d4e64d67 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 3 Aug 2019 15:31:40 -0400 Subject: Add a pango_shape variant that takes flags The only flag currently defined affects whether glyph positions are rounded or not. --- pango/pango-glyph.h | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'pango/pango-glyph.h') diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h index 917ec570..628eac96 100644 --- a/pango/pango-glyph.h +++ b/pango/pango-glyph.h @@ -189,18 +189,43 @@ void pango_glyph_string_x_to_index (PangoGlyphString *glyphs, /* Turn a string of characters into a string of glyphs */ PANGO_AVAILABLE_IN_ALL -void pango_shape (const gchar *text, - gint length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs); +void pango_shape (const char *text, + int length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs); PANGO_AVAILABLE_IN_1_32 -void pango_shape_full (const gchar *item_text, - gint item_length, - const gchar *paragraph_text, - gint paragraph_length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs); +void pango_shape_full (const char *item_text, + int item_length, + const char *paragraph_text, + int paragraph_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs); + +/** + * PangoShapeFlags: + * @PANGO_SHAPE_NONE: Default value. + * @PANGO_SHAPE_ROUND_POSITIONS: Round glyph positions + * and widths to whole device units. This option should + * be set if the target renderer can't do subpixel + * positioning of glyphs. + * + * Flags influencing the shaping process. + * These can be passed to pango_shape_with_flags(). + */ +typedef enum { + PANGO_SHAPE_NONE = 0, + PANGO_SHAPE_ROUND_POSITIONS = 1 << 0, +} PangoShapeFlags; + +PANGO_AVAILABLE_IN_1_44 +void pango_shape_with_flags (const char *item_text, + int item_length, + const char *paragraph_text, + int paragraph_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + PangoShapeFlags flags); PANGO_AVAILABLE_IN_ALL GList *pango_reorder_items (GList *logical_items); -- cgit v1.2.1