Index: pango/pango-utils.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-utils.c,v
retrieving revision 1.57
diff -u -p -r1.57 pango-utils.c
--- pango/pango-utils.c	22 Jul 2005 19:05:45 -0000	1.57
+++ pango/pango-utils.c	23 Jul 2005 18:55:33 -0000
@@ -1714,3 +1714,37 @@ pango_find_base_dir (const gchar *text,
 
   return dir;
 }
+
+/**
+ * pango_is_zero_width:
+ * @ch: a unicode character
+ *
+ * Checks @ch to see if it is a zero-width character that should not be
+ * normally rendered on the screen.
+ *
+ * Return value: %TRUE if @ch is a zero-width character, %FALSE otherwise
+ */
+gboolean
+pango_is_zero_width (gunichar ch)
+{
+/* 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
+ */
+  return (ch & ~0x003F == 0x2000 && (
+		(ch >= 0x200B && ch <= 0x200F) ||
+		ch == 0x2028 ||
+		(ch >= 0x202A && ch <= 0x202E)
+	 )) || ch == 0xFEFF;
+}
Index: pango/pango-utils.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-utils.h,v
retrieving revision 1.16
diff -u -p -r1.16 pango-utils.h
--- pango/pango-utils.h	27 Feb 2004 14:48:53 -0000	1.16
+++ pango/pango-utils.h	23 Jul 2005 18:55:33 -0000
@@ -86,8 +86,7 @@ G_CONST_RETURN char *   pango_get_lib_su
 
 #endif /* PANGO_ENABLE_BACKEND */
 
-/* A couple of routines from fribidi that we either wrap or
- * provide ourselves.
+/* A routine from fribidi that we either wrap or provide ourselves.
  */
 gboolean pango_log2vis_get_embedding_levels (gunichar       *str,
 					     int             len,
@@ -95,6 +94,11 @@ gboolean pango_log2vis_get_embedding_lev
 					     guint8         *embedding_level_list);
 
 G_CONST_RETURN char *pango_language_get_sample_string (PangoLanguage *language);
+
+/* Unicode characters that are zero-width and should not be rendered
+ * normally.
+ */
+G_GNUC_CONST gboolean pango_is_zero_width (gunichar ch);
 
 G_END_DECLS
 
Index: modules/arabic/arabic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/arabic/arabic-fc.c,v
retrieving revision 1.18
diff -u -p -r1.18 arabic-fc.c
--- modules/arabic/arabic-fc.c	10 Aug 2004 16:01:46 -0000	1.18
+++ modules/arabic/arabic-fc.c	23 Jul 2005 18:55:33 -0000
@@ -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);
 	}
Index: modules/basic/basic-common.h
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-common.h,v
retrieving revision 1.3
diff -u -p -r1.3 basic-common.h
--- modules/basic/basic-common.h	21 Jul 2005 18:15:35 -0000	1.3
+++ modules/basic/basic-common.h	23 Jul 2005 18:55:33 -0000
@@ -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
 
Index: modules/basic/basic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-fc.c,v
retrieving revision 1.19
diff -u -p -r1.19 basic-fc.c
--- modules/basic/basic-fc.c	23 Sep 2003 23:11:50 -0000	1.19
+++ modules/basic/basic-fc.c	23 Jul 2005 18:55:33 -0000
@@ -157,7 +157,7 @@ basic_engine_shape (PangoEngineShape *en
       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);
 	}
Index: modules/basic/basic-win32.c
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-win32.c,v
retrieving revision 1.36
diff -u -p -r1.36 basic-win32.c
--- modules/basic/basic-win32.c	28 Apr 2005 17:20:05 -0000	1.36
+++ modules/basic/basic-win32.c	23 Jul 2005 18:55:33 -0000
@@ -1003,7 +1003,7 @@ basic_engine_shape (PangoEngineShape *en
       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);
 	}
Index: modules/basic/basic-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-x.c,v
retrieving revision 1.38
diff -u -p -r1.38 basic-x.c
--- modules/basic/basic-x.c	23 Sep 2003 23:11:50 -0000	1.38
+++ modules/basic/basic-x.c	23 Jul 2005 18:55:33 -0000
@@ -607,7 +607,7 @@ basic_engine_shape (PangoEngineShape *en
 	  input = buf;
 	}
 		
-      if (ZERO_WIDTH_CHAR (wc))
+      if (pango_is_zero_width (wc))
 	{
 	  set_glyph (font, glyphs, i, p - text, 0);
 	}
Index: modules/hangul/hangul-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/hangul/hangul-fc.c,v
retrieving revision 1.16
diff -u -p -r1.16 hangul-fc.c
--- modules/hangul/hangul-fc.c	24 Apr 2005 16:32:57 -0000	1.16
+++ modules/hangul/hangul-fc.c	23 Jul 2005 18:55:34 -0000
@@ -275,10 +275,6 @@ render_syllable (PangoFont *font, gunich
     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 
     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,
Index: modules/indic/indic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/indic-fc.c,v
retrieving revision 1.16
diff -u -p -r1.16 indic-fc.c
--- modules/indic/indic-fc.c	5 Mar 2005 00:50:28 -0000	1.16
+++ modules/indic/indic-fc.c	23 Jul 2005 18:55:34 -0000
@@ -260,7 +260,7 @@ set_glyphs (PangoFont *font, FT_Face fac
     {
       guint glyph;
 
-      if (ZERO_WIDTH_CHAR (wcs[i]) &&
+      if (pango_is_zero_width (wcs[i]) &&
 	  (!process_zwj || wcs[i] != 0x200D))
 	glyph = 0;
       else
Index: modules/indic/indic-ot.h
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/indic-ot.h,v
retrieving revision 1.16
diff -u -p -r1.16 indic-ot.h
--- modules/indic/indic-ot.h	21 Jul 2005 22:13:50 -0000	1.16
+++ modules/indic/indic-ot.h	23 Jul 2005 18:55:34 -0000
@@ -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;
Index: modules/syriac/syriac-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/syriac/syriac-fc.c,v
retrieving revision 1.2
diff -u -p -r1.2 syriac-fc.c
--- modules/syriac/syriac-fc.c	21 Jul 2005 18:46:01 -0000	1.2
+++ modules/syriac/syriac-fc.c	23 Jul 2005 18:55:34 -0000
@@ -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);
 	}

