summaryrefslogtreecommitdiff
path: root/modules/basic/basic-fc.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-09-26 15:37:20 -0400
committerBehdad Esfahbod <behdad@behdad.org>2012-09-26 15:37:20 -0400
commitbbec7e8697907a922f80c00b94f54b9b8634d264 (patch)
tree18c737c4c838199b9e6ca72383afdcd09e874af5 /modules/basic/basic-fc.c
parent1c151fef87c61e2d329d84d3db59559bffa767fe (diff)
downloadpango-bbec7e8697907a922f80c00b94f54b9b8634d264.tar.gz
Add pango_shape_full()
Variant of pango_shape() that takes the full paragraph text as input. This is then passed in entirety to HarfBuzz, which would allow certain cross-run interactions (in Arabic for example). When combined with upcoming HarfBuzz 0.9.5+, this fixes: Red Hat Bug 858736 - [Spanish] Stray dotted circle rendered https://bugzilla.redhat.com/show_bug.cgi?id=858736 and partially: Bug 313181 - color changes break arabic shaping https://bugzilla.gnome.org/show_bug.cgi?id=313181
Diffstat (limited to 'modules/basic/basic-fc.c')
-rw-r--r--modules/basic/basic-fc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 1def0552..ef0277ea 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -295,12 +295,14 @@ pango_fc_get_hb_font_funcs (void)
static void
-basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
- PangoFont *font,
- const char *text,
- gint length,
+basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
+ PangoFont *font,
+ const char *item_text,
+ unsigned int item_length,
const PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
+ PangoGlyphString *glyphs,
+ const char *paragraph_text,
+ unsigned int paragraph_length)
{
PangoFcHbContext context;
PangoFcFont *fc_font;
@@ -317,8 +319,6 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
guint i, num_glyphs;
g_return_if_fail (font != NULL);
- g_return_if_fail (text != NULL);
- g_return_if_fail (length >= 0);
g_return_if_fail (analysis != NULL);
fc_font = PANGO_FC_FONT (font);
@@ -362,7 +362,7 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
hb_buffer_set_script (hb_buffer, hb_glib_script_to_script (analysis->script));
hb_buffer_set_language (hb_buffer, hb_language_from_string (pango_language_to_string (analysis->language), -1));
- hb_buffer_add_utf8 (hb_buffer, text, length, 0, length);
+ hb_buffer_add_utf8 (hb_buffer, paragraph_text, paragraph_length, item_text - paragraph_text, item_length);
hb_shape (hb_font, hb_buffer, NULL, 0);
if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity))