From b818431d079e3a7d2f549ac84270acec397c462f Mon Sep 17 00:00:00 2001 From: Changwoo Ryu Date: Sun, 24 Apr 2005 16:32:57 +0000 Subject: handles zero width chars, patch by Young-Ho Cha. (#157565) 2005-04-25 Changwoo Ryu * modules/hangul/hangul-fc.c (render_basic): handles zero width chars, patch by Young-Ho Cha. (#157565) --- ChangeLog | 5 +++++ ChangeLog.pre-1-10 | 5 +++++ modules/hangul/hangul-fc.c | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 157e4b35..80635141 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-25 Changwoo Ryu + + * modules/hangul/hangul-fc.c (render_basic): handles zero width + chars, patch by Young-Ho Cha. (#157565) + Mon Apr 18 15:49:36 2005 Manish Singh * examples/cairoview.c: Update to new Cairo API for setting color diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 157e4b35..80635141 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,8 @@ +2005-04-25 Changwoo Ryu + + * modules/hangul/hangul-fc.c (render_basic): handles zero width + chars, patch by Young-Ho Cha. (#157565) + Mon Apr 18 15:49:36 2005 Manish Singh * examples/cairoview.c: Update to new Cairo API for setting color diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index f7f5557b..75dfa7c9 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -275,6 +275,10 @@ render_syllable (PangoFont *font, gunichar *text, int length, render_tone(font, tone, glyphs, n_glyphs, cluster_offset); } +/* stolen from basic module */ +#define ZERO_WIDTH_CHAR(wc)\ +(((wc) >= 0x200B && (wc) <= 0x200F) || ((wc) >= 0x202A && (wc) <= 0x202E) || ((wc) == 0xFEFF)) + static void render_basic (PangoFont *font, gunichar wc, PangoGlyphString *glyphs, int *n_glyphs, int cluster_offset) @@ -288,9 +292,14 @@ render_basic (PangoFont *font, gunichar wc, pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (index) set_glyph (font, glyphs, *n_glyphs, cluster_offset, index); - else - set_glyph (font, glyphs, *n_glyphs, cluster_offset, - get_unknown_glyph (font, wc)); + else + { + if (ZERO_WIDTH_CHAR (wc)) + set_glyph (font, glyphs, *n_glyphs, cluster_offset, 0); + else + set_glyph (font, glyphs, *n_glyphs, cluster_offset, + get_unknown_glyph (font, wc)); + } (*n_glyphs)++; } -- cgit v1.2.1