summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2002-03-26 23:24:54 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-03-26 23:24:54 +0000
commit2606c3af9a32953b5f2eb4f5bfac4aa395f7e607 (patch)
treeabcaf26470b618e60165557b55a72c5d358fddf5 /modules
parent9d36c1dc2da9797cf08a915008c49570ff38578c (diff)
downloadpango-2606c3af9a32953b5f2eb4f5bfac4aa395f7e607.tar.gz
ue Mar 26 18:22:07 2002 Owen Taylor <otaylor@redhat.com>
* modules/basic/basic-*.c modules/basic/basic-common.h: Move ZERO_WIDTH_CHAR() macro into a common header file, add ZERO WIDTH-NO BREAK SPACE (U+FEFF) * modules/basic/Makefile.am (EXTRA_DIST): Add basic-common.h.
Diffstat (limited to 'modules')
-rw-r--r--modules/basic/Makefile.am1
-rw-r--r--modules/basic/basic-common.h26
-rw-r--r--modules/basic/basic-fc.c19
-rw-r--r--modules/basic/basic-ft2.c20
-rw-r--r--modules/basic/basic-win32.c4
-rw-r--r--modules/basic/basic-x.c19
-rw-r--r--modules/basic/basic-xft.c19
7 files changed, 36 insertions, 72 deletions
diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am
index c6ca85de..c22cadca 100644
--- a/modules/basic/Makefile.am
+++ b/modules/basic/Makefile.am
@@ -115,6 +115,7 @@ pango_basic_win32_la_SOURCES = basic-win32.c
libpango_basic_win32_la_SOURCES = basic-win32.c
EXTRA_DIST = \
+ basic-common.h \
tables-big.i \
tables-small.i \
makefile.mingw \
diff --git a/modules/basic/basic-common.h b/modules/basic/basic-common.h
new file mode 100644
index 00000000..2932e383
--- /dev/null
+++ b/modules/basic/basic-common.h
@@ -0,0 +1,26 @@
+#ifndef __BASIC_COMMON_H__
+#define __BASIC_COMMON_H__
+
+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
+ * 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) >= 0x202A && (wc) <= 0x202E) || ((wc) == 0xFEFF))
+
+G_END_DECLS
+
+#endif /* __BASIC_COMMON_H__ */
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 26d0d58c..f72ae195 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -26,24 +26,7 @@
#include "pango-engine.h"
#include "pango-utils.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
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- */
-
-#define ZERO_WIDTH_CHAR(wc)\
-(((wc) >= 0x200B && (wc) <= 0x200F) || ((wc) >= 0x202A && (wc) <= 0x202E))
-
+#include "basic-common.h"
static PangoEngineRange basic_ranges[] = {
/* Language characters */
diff --git a/modules/basic/basic-ft2.c b/modules/basic/basic-ft2.c
index 77fdd084..63d596ad 100644
--- a/modules/basic/basic-ft2.c
+++ b/modules/basic/basic-ft2.c
@@ -27,25 +27,11 @@
#include "pangoft2.h"
#include "pango-utils.h"
-#define SCRIPT_ENGINE_NAME "BasicScriptEngineFT2"
-
+#include "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
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- */
+#define SCRIPT_ENGINE_NAME "BasicScriptEngineFT2"
-#define ZERO_WIDTH_CHAR(wc)\
-(((wc) >= 0x200B && (wc) <= 0x200F) || ((wc) >= 0x202A && (wc) <= 0x202E))
+#include "basic-common.h"
static PangoEngineRange basic_ranges[] = {
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index f5e75be5..b5c61f6a 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -25,6 +25,8 @@
#include "pango-engine.h"
#include "pango-utils.h"
+#include "basic-common.h"
+
#define SCRIPT_ENGINE_NAME "BasicScriptEngineWin32"
static PangoEngineRange basic_ranges[] = {
@@ -143,7 +145,7 @@ basic_engine_shape (PangoFont *font,
if (wc == 0xa0) /* non-break-space */
wc = 0x20;
- if (wc == 0x200B || wc == 0x200E || wc == 0x200F) /* Zero-width characters */
+ if (ZERO_WIDTH_CHAR (wc))
{
set_glyph (font, glyphs, i, p - text, 0);
}
diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c
index ced21fd8..e76a9929 100644
--- a/modules/basic/basic-x.c
+++ b/modules/basic/basic-x.c
@@ -25,24 +25,7 @@
#include "pango-engine.h"
#include "pango-utils.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
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- */
-
-#define ZERO_WIDTH_CHAR(wc)\
-(((wc) >= 0x200B && (wc) <= 0x200F) || ((wc) >= 0x202A && (wc) <= 0x202E))
-
+#include "basic-common.h"
typedef struct _CharRange CharRange;
typedef struct _Charset Charset;
diff --git a/modules/basic/basic-xft.c b/modules/basic/basic-xft.c
index 26d0d58c..f72ae195 100644
--- a/modules/basic/basic-xft.c
+++ b/modules/basic/basic-xft.c
@@ -26,24 +26,7 @@
#include "pango-engine.h"
#include "pango-utils.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
- * 202A LEFT-TO-RIGHT EMBEDDING
- * 202B RIGHT-TO-LEFT EMBEDDING
- * 202C POP DIRECTIONAL FORMATTING
- * 202D LEFT-TO-RIGHT OVERRIDE
- * 202E RIGHT-TO-LEFT OVERRIDE
- */
-
-#define ZERO_WIDTH_CHAR(wc)\
-(((wc) >= 0x200B && (wc) <= 0x200F) || ((wc) >= 0x202A && (wc) <= 0x202E))
-
+#include "basic-common.h"
static PangoEngineRange basic_ranges[] = {
/* Language characters */