From 8f690b9373af578eef8cf05dc18b022c78f0ebb3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Jan 2006 12:50:14 +0000 Subject: Draw an unknown glyph on missing glyphs, like other modules do. (part of 2006-01-23 Behdad Esfahbod * modules/indic/indic-fc.c: Draw an unknown glyph on missing glyphs, like other modules do. (part of bug #326960, LingNing Zhang) --- ChangeLog | 5 +++++ modules/indic/indic-fc.c | 29 +++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index b52db6f4..065f0cd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-01-23 Behdad Esfahbod + + * modules/indic/indic-fc.c: Draw an unknown glyph on missing glyphs, + like other modules do. (part of bug #326960, LingNing Zhang) + 2006-01-21 Behdad Esfahbod * pango/pangocairo-fontmap.c (pango_cairo_context_get_font_options): diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index b1a8ba6e..216dc6c2 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -234,7 +234,7 @@ get_gpos_ruleset (FT_Face face, const PangoIndicInfo *indic_info) ruleset = pango_ot_ruleset_new (info); - if (1 && pango_ot_info_find_script (info, PANGO_OT_TABLE_GPOS, + if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GPOS, indic_info->scriptTag, &script_index)) { maybe_add_GPOS_feature (ruleset, info, script_index, FT_MAKE_TAG ('b','l','w','m'), blwm); @@ -250,11 +250,19 @@ get_gpos_ruleset (FT_Face face, const PangoIndicInfo *indic_info) } static void -set_glyphs (PangoFont *font, FT_Face face, const gunichar *wcs, gulong *tags, glong n_glyphs, PangoOTBuffer *buffer, gboolean process_zwj) +set_glyphs (PangoFont *font, + const gunichar *wcs, + gulong *tags, + glong n_glyphs, + PangoOTBuffer *buffer, + gboolean process_zwj) { gint i; + PangoFcFont *fc_font; + + g_assert (font); - g_assert (face); + fc_font = PANGO_FC_FONT (font); for (i = 0; i < n_glyphs; i += 1) { @@ -264,9 +272,14 @@ set_glyphs (PangoFont *font, FT_Face face, const gunichar *wcs, gulong *tags, gl (!process_zwj || wcs[i] != 0x200D)) glyph = 0; else - glyph = FT_Get_Char_Index (face, wcs[i]); - - pango_ot_buffer_add_glyph (buffer, glyph, tags[i], i); + { + glyph = pango_fc_font_get_glyph (fc_font, wcs[i]); + + if (!glyph) + glyph = pango_fc_font_get_unknown_glyph (fc_font, wcs[i]); + + pango_ot_buffer_add_glyph (buffer, glyph, tags[i], i); + } } } @@ -287,7 +300,7 @@ expand_text(const gchar *text, glong length, glong **offsets, glong *n_chars) p = text; wco = wcs; oo = *offsets; - for (i = 0; i < *n_chars; i += 1) + for (i = 0; i < *n_chars; i++) { *wco++ = g_utf8_get_char (p); *oo++ = p - text; @@ -349,7 +362,7 @@ indic_engine_shape (PangoEngineShape *engine, pango_glyph_string_set_size (glyphs, n_glyphs); buffer = pango_ot_buffer_new (fc_font); - set_glyphs(font, face, wc_out, tags, n_glyphs, buffer, + set_glyphs(font, wc_out, tags, n_glyphs, buffer, (indic_info->classTable->scriptFlags & SF_PROCESS_ZWJ) != 0); /* do gsub processing */ -- cgit v1.2.1