diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-02-02 10:52:49 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-02-02 10:52:49 +0000 |
commit | da58dbfdea113caa46448c0bb3bf945b4a18f502 (patch) | |
tree | bd04c2e6d5d4f74ee5eef9a3dd8a1c2bdaeb5f7e /modules | |
parent | 93be594100f783b409cba98f6c9d58060c4ef433 (diff) | |
download | pango-da58dbfdea113caa46448c0bb3bf945b4a18f502.tar.gz |
Use PANGO_GLYPH_NULL for when no glyph should be drawn. Use
2006-02-02 Behdad Esfahbod <behdad@gnome.org>
* modules/arabic/arabic-fc.c, modules/basic/basic-atsui.c,
modules/basic/basic-fc.c, modules/basic/basic-win32.c,
modules/basic/basic-x.c, modules/hangul/hangul-fc.c,
modules/hebrew/hebrew-fc.c, modules/indic/indic-fc.c,
modules/khmer/khmer-fc.c, modules/syriac/syriac-fc.c,
modules/thai/thai-fc.c, modules/tibetan/tibetan-fc.c,
pango/fonts.c, pango/pango-engine-private.h pango/pango-types.h,
pango/pangocairo-fcfont.c, pango/pangocairo-font.c,
pango/pangocairo-private.h, pango/pangocairo-render.c,
pango/pangofc-decoder.c, pango/pangofc-font.c,
pango/pangoft2-render.c, pango/pangoft2.c pango/pangowin32.c,
pango/pangox.c, pango/pangoxft-font.c pango/pangoxft-private.h,
pango/pangoxft-render.c, pango/shape.c: Use PANGO_GLYPH_NULL for
when no glyph should be drawn. Use PANGO_GLYPH_UNKNOWN_FLAG for
all backends to mark unknown flags. There's no need for
pango_font_get_unknown_glyph() anymore, since all backends know
how to handle PANGO_GLYPH_UNKNOWN_FLAG gracefully. We may add
that in the future however. (fixes bug #73147, closes bug #329524)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/arabic/arabic-fc.c | 4 | ||||
-rw-r--r-- | modules/basic/basic-atsui.c | 2 | ||||
-rw-r--r-- | modules/basic/basic-fc.c | 4 | ||||
-rw-r--r-- | modules/basic/basic-win32.c | 4 | ||||
-rw-r--r-- | modules/basic/basic-x.c | 10 | ||||
-rw-r--r-- | modules/hangul/hangul-fc.c | 24 | ||||
-rw-r--r-- | modules/hebrew/hebrew-fc.c | 4 | ||||
-rw-r--r-- | modules/indic/indic-fc.c | 4 | ||||
-rw-r--r-- | modules/khmer/khmer-fc.c | 2 | ||||
-rw-r--r-- | modules/syriac/syriac-fc.c | 4 | ||||
-rw-r--r-- | modules/thai/thai-fc.c | 2 | ||||
-rw-r--r-- | modules/tibetan/tibetan-fc.c | 2 |
12 files changed, 33 insertions, 33 deletions
diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c index d72aebc1..84663d45 100644 --- a/modules/arabic/arabic-fc.c +++ b/modules/arabic/arabic-fc.c @@ -209,13 +209,13 @@ fallback_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) index = pango_fc_font_get_unknown_glyph (fc_font, wc); set_glyph (font, glyphs, i, p - text, index); diff --git a/modules/basic/basic-atsui.c b/modules/basic/basic-atsui.c index 08391d6a..72d83db4 100644 --- a/modules/basic/basic-atsui.c +++ b/modules/basic/basic-atsui.c @@ -160,7 +160,7 @@ basic_engine_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index c260f42b..f73f1a56 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -166,13 +166,13 @@ fallback_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) { index = pango_fc_font_get_unknown_glyph (fc_font, wc); set_glyph (font, glyphs, i, p - text, index); diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index 58624293..433eb21a 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -1003,12 +1003,12 @@ basic_engine_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { index = find_char (font, wc); - if (index) + if (index != PANGO_GLYPH_NULL) { set_glyph (font, glyphs, i, p - text, index); diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c index 0ff0f863..1e0a66a0 100644 --- a/modules/basic/basic-x.c +++ b/modules/basic/basic-x.c @@ -284,7 +284,7 @@ find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input) } } - return 0; + return PANGO_GLYPH_NULL; } static void @@ -610,12 +610,12 @@ basic_engine_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { index = find_char (cache, font, wc, input); - if (index) + if (index != PANGO_GLYPH_NULL) { set_glyph (font, glyphs, i, p - text, index); @@ -640,7 +640,7 @@ basic_engine_shape (PangoEngineShape *engine, } } else - set_glyph (font, glyphs, i, p - text, pango_x_get_unknown_glyph (font)); + set_glyph (font, glyphs, i, p - text, pango_x_font_get_unknown_glyph (font, wc)); } p = g_utf8_next_char (p); @@ -680,7 +680,7 @@ basic_engine_covers (PangoEngineShape *engine, g_unichar_to_utf8 (wc, buf); - return find_char (cache, font, wc, buf) ? PANGO_COVERAGE_EXACT : PANGO_COVERAGE_NONE; + return find_char (cache, font, wc, buf) != PANGO_GLYPH_NULL ? PANGO_COVERAGE_EXACT : PANGO_COVERAGE_NONE; } static void diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 991b305f..5d3e0f73 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -138,7 +138,7 @@ render_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs, index = find_char (font, tone); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); - if (index) + if (index != PANGO_GLYPH_NULL) { set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index); } @@ -146,7 +146,7 @@ render_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs, { /* fall back : HTONE1(0x302e) => middle-dot, HTONE2(0x302f) => colon */ index = find_char (font, tone == HTONE1 ? 0x00b7 : 0x003a); - if (index) + if (index != PANGO_GLYPH_NULL) { set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index); } @@ -167,11 +167,11 @@ render_isolated_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs, /* Find a base character to render the mark on */ int index = find_char (font, 0x25cc); /* DOTTED CIRCLE */ - if (!index) + if (index == PANGO_GLYPH_NULL) index = find_char (font, 0x25cb); /* WHITE CIRCLE, in KSC-5601 */ - if (!index) + if (index == PANGO_GLYPH_NULL) index = find_char (font, ' '); /* Space */ - if (!index) /* Unknown glyph box with 0000 in it */ + if (index == PANGO_GLYPH_NULL) /* Unknown glyph box with 0000 in it */ index = find_char (font, get_unknown_glyph (font, 0)); /* Add the base character @@ -217,7 +217,7 @@ render_syllable (PangoFont *font, gunichar *text, int length, wc = S_FROM_LV(text[0], text[1]); index = find_char (font, wc); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); - if (!index) + if (index == PANGO_GLYPH_NULL) set_glyph (font, glyphs, *n_glyphs, cluster_offset, get_unknown_glyph (font, wc)); else @@ -236,7 +236,7 @@ render_syllable (PangoFont *font, gunichar *text, int length, continue; index = find_char (font, text[i]); - if (index) + if (index != PANGO_GLYPH_NULL) { pango_glyph_string_set_size (glyphs, *n_glyphs + 1); set_glyph (font, glyphs, *n_glyphs, cluster_offset, index); @@ -250,9 +250,9 @@ render_syllable (PangoFont *font, gunichar *text, int length, for (j = 0; j < 3 && (__jamo_to_ksc5601[jindex][j] != 0); j++) { wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE; - index = (wc >= 0x3131) ? find_char (font, wc) : 0; + index = (wc >= 0x3131) ? find_char (font, wc) : PANGO_GLYPH_NULL; pango_glyph_string_set_size (glyphs, *n_glyphs + 1); - if (!index) + if (index == PANGO_GLYPH_NULL) set_glyph (font, glyphs, *n_glyphs, cluster_offset, get_unknown_glyph (font, index)); else @@ -264,7 +264,7 @@ render_syllable (PangoFont *font, gunichar *text, int length, { index = find_char (font, 0x3164); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); - if (!index) + if (index == PANGO_GLYPH_NULL) set_glyph (font, glyphs, *n_glyphs, cluster_offset, get_unknown_glyph (font, index)); else @@ -287,12 +287,12 @@ render_basic (PangoFont *font, gunichar wc, index = find_char (font, wc); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); - if (index) + if (index != PANGO_GLYPH_NULL) set_glyph (font, glyphs, *n_glyphs, cluster_offset, index); else { if (pango_is_zero_width (wc)) - set_glyph (font, glyphs, *n_glyphs, cluster_offset, 0); + set_glyph (font, glyphs, *n_glyphs, cluster_offset, PANGO_GLYPH_NULL); else set_glyph (font, glyphs, *n_glyphs, cluster_offset, get_unknown_glyph (font, wc)); diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c index 9ffe289c..fd12d983 100644 --- a/modules/hebrew/hebrew-fc.c +++ b/modules/hebrew/hebrew-fc.c @@ -348,13 +348,13 @@ hebrew_engine_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) /* Zero-width characters */ { - pango_ot_buffer_add_glyph (buffer, 0, unknown_property, p - text); + pango_ot_buffer_add_glyph (buffer, PANGO_GLYPH_NULL, unknown_property, p - text); } else { index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) { pango_ot_buffer_add_glyph (buffer, pango_fc_font_get_unknown_glyph (fc_font, wc), unknown_property, p - text); diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index 3e3ec23e..187067cb 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -272,12 +272,12 @@ set_glyphs (PangoFont *font, if (pango_is_zero_width (wcs[i]) && (!process_zwj || wcs[i] != 0x200D)) - glyph = 0; + glyph = PANGO_GLYPH_NULL; else { glyph = pango_fc_font_get_glyph (fc_font, wcs[i]); - if (!glyph) + if (glyph == PANGO_GLYPH_NULL) glyph = pango_fc_font_get_unknown_glyph (fc_font, wcs[i]); pango_ot_buffer_add_glyph (buffer, glyph, tags[i], i); diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index 75cebf87..ee585d31 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -508,7 +508,7 @@ static PangoGlyph get_index (PangoFcFont *fc_font, gunichar wc) { PangoGlyph index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) index = pango_fc_font_get_unknown_glyph (fc_font, wc); return index; } diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c index 300ce5d3..60cadd36 100644 --- a/modules/syriac/syriac-fc.c +++ b/modules/syriac/syriac-fc.c @@ -201,13 +201,13 @@ fallback_shape (PangoEngineShape *engine, if (pango_is_zero_width (wc)) { - set_glyph (font, glyphs, i, p - text, 0); + set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_NULL); } else { index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) index = pango_fc_font_get_unknown_glyph (fc_font, wc); set_glyph (font, glyphs, i, p - text, index); diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index 9a038e8b..46d77e71 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -228,7 +228,7 @@ thai_make_glyph_uni (ThaiFontInfo *font_info, gunichar uc) PangoFcFont *fc_font = (PangoFcFont *)font_info->font; result = pango_fc_font_get_glyph (fc_font, uc); - if (result) + if (result != PANGO_GLYPH_NULL) return result; else return pango_fc_font_get_unknown_glyph (fc_font, uc); diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index 77a10ca7..7294724b 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -473,7 +473,7 @@ static PangoGlyph get_index (PangoFcFont *fc_font, gunichar wc) { PangoGlyph index = pango_fc_font_get_glyph (fc_font, wc); - if (!index) + if (index == PANGO_GLYPH_NULL) index = pango_fc_font_get_unknown_glyph (fc_font, wc); return index; } |