summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-01-23 12:50:14 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-01-23 12:50:14 +0000
commit8f690b9373af578eef8cf05dc18b022c78f0ebb3 (patch)
treed739a6a10967ef42b493aa2c850918838f2971b1
parent1e28d59d8c3e49fa6b265ccbe3631e284490e392 (diff)
downloadpango-8f690b9373af578eef8cf05dc18b022c78f0ebb3.tar.gz
Draw an unknown glyph on missing glyphs, like other modules do. (part of
2006-01-23 Behdad Esfahbod <behdad@gnome.org> * modules/indic/indic-fc.c: Draw an unknown glyph on missing glyphs, like other modules do. (part of bug #326960, LingNing Zhang)
-rw-r--r--ChangeLog5
-rw-r--r--modules/indic/indic-fc.c29
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 <behdad@gnome.org>
+
+ * 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 <behdad@gnome.org>
* 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 */