summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBehdad Esfahbod <pango@behdad.org>2005-07-23 19:24:48 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-07-23 19:24:48 +0000
commitd5142f02455703ea61bd11f308ef844e9b20ebbd (patch)
treeeee87660e4825754892fd64e65499bfc138aa78b /modules
parent1470d761b0faf8de46ff38163272a9a6af6c5e64 (diff)
downloadpango-d5142f02455703ea61bd11f308ef844e9b20ebbd.tar.gz
New function added.
2005-07-23 Behdad Esfahbod <pango@behdad.org> * pango/pango-utils.c, pango/pango-utils.h (pango_is_zerowidth): New function added. * modules/basic/basic-common.h, modules/basic/basic-fc.c, modules/basic/basic-win32.c, modules/basic/basic-x.c, modules/hangul/hangul-fc.c, modules/arabic/arabic-fc.c, modules/indic/indic-fc.c, modules/indic/indic-ot.h, modules/syriac/syriac-fc.c: Use the new pango_is_zerowidth function. (#306639, Behnam Esfahbod)
Diffstat (limited to 'modules')
-rw-r--r--modules/arabic/arabic-fc.c2
-rw-r--r--modules/basic/basic-common.h18
-rw-r--r--modules/basic/basic-fc.c2
-rw-r--r--modules/basic/basic-win32.c2
-rw-r--r--modules/basic/basic-x.c2
-rw-r--r--modules/hangul/hangul-fc.c6
-rw-r--r--modules/indic/indic-fc.c2
-rw-r--r--modules/indic/indic-ot.h20
-rw-r--r--modules/syriac/syriac-fc.c2
9 files changed, 7 insertions, 49 deletions
diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c
index 04ea2418..657eaf2a 100644
--- a/modules/arabic/arabic-fc.c
+++ b/modules/arabic/arabic-fc.c
@@ -197,7 +197,7 @@ fallback_shape (PangoEngineShape *engine,
input = buf;
}
- if (wc >= 0x200B && wc <= 0x200F) /* Zero-width characters */
+ if (pango_is_zero_width (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}
diff --git a/modules/basic/basic-common.h b/modules/basic/basic-common.h
index 3c140ad9..a3c0d16e 100644
--- a/modules/basic/basic-common.h
+++ b/modules/basic/basic-common.h
@@ -24,24 +24,6 @@
G_BEGIN_DECLS
-/* Zero Width characters:
- *
- * 200B ZERO WIDTH SPACE
- * 200C ZERO WIDTH NON-JOINER
- * 200D ZERO WIDTH JOINER
- * 200E LEFT-TO-RIGHT MARK
- * 200F RIGHT-TO-LEFT MARK
- * 2028 LINE SEPARATOR
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- * FEFF ZERO WIDTH NO-BREAK SPACE
- */
-
-#define ZERO_WIDTH_CHAR(wc)\
-(((wc) >= 0x200B && (wc) <= 0x200F) || (wc == 0x2028) || ((wc) >= 0x202A && (wc) <= 0x202E) || ((wc) == 0xFEFF))
G_END_DECLS
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 6fb28ecf..6d80d938 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -157,7 +157,7 @@ basic_engine_shape (PangoEngineShape *engine,
if (wc == 0xa0) /* non-break-space */
wc = 0x20;
- if (ZERO_WIDTH_CHAR (wc))
+ if (pango_is_zero_width (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index 2ffc090b..9e068409 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -1003,7 +1003,7 @@ basic_engine_shape (PangoEngineShape *engine,
if (wc == 0xa0) /* non-break-space */
wc = 0x20;
- if (ZERO_WIDTH_CHAR (wc))
+ if (pango_is_zero_width (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}
diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c
index d0ba9c48..22dbb671 100644
--- a/modules/basic/basic-x.c
+++ b/modules/basic/basic-x.c
@@ -607,7 +607,7 @@ basic_engine_shape (PangoEngineShape *engine,
input = buf;
}
- if (ZERO_WIDTH_CHAR (wc))
+ if (pango_is_zero_width (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}
diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c
index 75dfa7c9..ad7a239a 100644
--- a/modules/hangul/hangul-fc.c
+++ b/modules/hangul/hangul-fc.c
@@ -275,10 +275,6 @@ 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)
@@ -294,7 +290,7 @@ render_basic (PangoFont *font, gunichar wc,
set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
else
{
- if (ZERO_WIDTH_CHAR (wc))
+ if (pango_is_zero_width (wc))
set_glyph (font, glyphs, *n_glyphs, cluster_offset, 0);
else
set_glyph (font, glyphs, *n_glyphs, cluster_offset,
diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c
index c795a210..b1a8ba6e 100644
--- a/modules/indic/indic-fc.c
+++ b/modules/indic/indic-fc.c
@@ -260,7 +260,7 @@ set_glyphs (PangoFont *font, FT_Face face, const gunichar *wcs, gulong *tags, gl
{
guint glyph;
- if (ZERO_WIDTH_CHAR (wcs[i]) &&
+ if (pango_is_zero_width (wcs[i]) &&
(!process_zwj || wcs[i] != 0x200D))
glyph = 0;
else
diff --git a/modules/indic/indic-ot.h b/modules/indic/indic-ot.h
index 7d92b0c6..dd34144f 100644
--- a/modules/indic/indic-ot.h
+++ b/modules/indic/indic-ot.h
@@ -205,26 +205,6 @@ enum indic_glyph_property_
#define HAS_BELOW_BASE_FORM(charClass) ((charClass & CF_BELOW_BASE) != 0)
-/* This macro definition is shared with basic-common.h
- *
- * Zero Width characters:
- *
- * 200B ZERO WIDTH SPACE
- * 200C ZERO WIDTH NON-JOINER
- * 200D ZERO WIDTH JOINER
- * 200E LEFT-TO-RIGHT MARK
- * 200F RIGHT-TO-LEFT MARK
- * 2028 LINE SEPARATOR
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- * FEFF ZERO WIDTH NO-BREAK SPACE
- */
-#define ZERO_WIDTH_CHAR(wc) \
- (((wc) >= 0x200B && (wc) <= 0x200F) || (wc == 0x2028) || ((wc) >= 0x202A && (wc) <= 0x202E) || ((wc) == 0xFEFF))
-
struct _IndicOTClassTable
{
gunichar firstChar;
diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c
index 4a78ab3d..8f054c55 100644
--- a/modules/syriac/syriac-fc.c
+++ b/modules/syriac/syriac-fc.c
@@ -196,7 +196,7 @@ fallback_shape (PangoEngineShape *engine,
pango_get_mirror_char (wc, &mirrored_ch))
wc = mirrored_ch;
- if (wc >= 0x200B && wc <= 0x200F) /* Zero-width characters */
+ if (pango_is_zero_width (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}