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 /pango/pangowin32.c | |
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 'pango/pangowin32.c')
-rw-r--r-- | pango/pangowin32.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/pango/pangowin32.c b/pango/pangowin32.c index c72d81e1..77970285 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -31,8 +31,6 @@ #include "pangowin32.h" #include "pangowin32-private.h" -#define PANGO_WIN32_UNKNOWN_FLAG 0x10000000 - #define CH_IS_UNIHAN_BMP(ch) ((ch) >= 0x3400 && (ch) <= 0x9FFF) #define CH_IS_UNIHAN(ch) (CH_IS_UNIHAN_BMP (ch) || \ ((ch) >= 0x20000 && (ch) <= 0x2A6DF) || \ @@ -313,11 +311,11 @@ pango_win32_render (HDC hdc, * point zero (just spacing). */ while (i < glyphs->num_glyphs && - (glyphs->glyphs[i].glyph == 0 || cur_y_offset == glyphs->glyphs[i].geometry.y_offset)) + (glyphs->glyphs[i].glyph == PANGO_GLYPH_NULL || cur_y_offset == glyphs->glyphs[i].geometry.y_offset)) { - if (glyphs->glyphs[i].glyph == 0) + if (glyphs->glyphs[i].glyph == PANGO_GLYPH_NULL) { - /* Code point 0 glyphs should not be rendered, but their + /* PANGO_GLYPH_NULL glyphs should not be rendered, but their * indicated width (set up by PangoLayout) should be taken * into account. */ @@ -337,7 +335,7 @@ pango_win32_render (HDC hdc, } else { - if (glyphs->glyphs[i].glyph & PANGO_WIN32_UNKNOWN_FLAG) + if (glyphs->glyphs[i].glyph & PANGO_GLYPH_UNKNOWN_FLAG) { /* Glyph index is actually the char value that doesn't * have any glyph (ORed with the flag). We should really @@ -462,7 +460,7 @@ pango_win32_font_get_glyph_extents (PangoFont *font, MAT2 m = {{0,1}, {0,0}, {0,0}, {0,1}}; PangoWin32GlyphInfo *info; - if (glyph & PANGO_WIN32_UNKNOWN_FLAG) + if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) glyph_index = glyph = 0; info = g_hash_table_lookup (win32font->glyph_info, GUINT_TO_POINTER (glyph)); @@ -869,7 +867,7 @@ PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font, gunichar wc) { - return wc | PANGO_WIN32_UNKNOWN_FLAG; + return wc | PANGO_GLYPH_UNKNOWN_FLAG; } /** @@ -1383,7 +1381,7 @@ pango_win32_font_get_glyph_index (PangoFont *font, cmap = font_get_cmap (font); if (cmap == NULL) - return 0; + return PANGO_GLYPH_NULL; if (win32font->win32face->cmap_format == 4) { @@ -1396,10 +1394,10 @@ pango_win32_font_get_glyph_index (PangoFont *font, guint16 ch = wc; if (wc > 0xFFFF) - return 0; + return PANGO_GLYPH_NULL; if (!find_segment (cmap4, ch, &segment)) - return 0; + return PANGO_GLYPH_NULL; id_range_offset = get_id_range_offset (cmap4); id_delta = get_id_delta (cmap4); @@ -1415,7 +1413,7 @@ pango_win32_font_get_glyph_index (PangoFont *font, if (id) glyph = (id_delta[segment] + id) %65536; else - glyph = 0; + glyph = PANGO_GLYPH_NULL; } } else if (win32font->win32face->cmap_format == 12) @@ -1423,7 +1421,7 @@ pango_win32_font_get_glyph_index (PangoFont *font, struct format_12_cmap *cmap12 = cmap; guint32 i; - glyph = 0; + glyph = PANGO_GLYPH_NULL; for (i = 0; i < cmap12->count; i++) { if (cmap12->groups[i*3+0] <= wc && wc <= cmap12->groups[i*3+1]) |