diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-02-23 22:37:16 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-02-23 22:37:16 +0000 |
commit | 174be47332b5bfbf845bfa92fda995d1b23a98ba (patch) | |
tree | 7f21cf75de5b883fe8bf7d5bdd7bac42a44230e3 /modules | |
parent | 1540e6d485f78b52cfb3aab112ef18e168ac86a9 (diff) | |
download | pango-174be47332b5bfbf845bfa92fda995d1b23a98ba.tar.gz |
Patch from Sven Neumann to extend and make consistent the set of
Sat Feb 23 17:34:26 2002 Owen Taylor <otaylor@redhat.com>
* modules/basic/basic-{ft2,x,xft}.c: Patch from Sven Neumann
to extend and make consistent the set of zero-width characters
that are not displayed. (#71931)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/basic/basic-fc.c | 21 | ||||
-rw-r--r-- | modules/basic/basic-ft2.c | 21 | ||||
-rw-r--r-- | modules/basic/basic-x.c | 21 | ||||
-rw-r--r-- | modules/basic/basic-xft.c | 21 |
4 files changed, 80 insertions, 4 deletions
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index 6552a347..0d2ea653 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -26,6 +26,25 @@ #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)) + + static PangoEngineRange basic_ranges[] = { /* Language characters */ { 0x0380, 0x058f, "*" }, @@ -142,7 +161,7 @@ basic_engine_shape (PangoFont *font, input = buf; } - if (wc >= 0x200B && wc <= 0x200F) /* Zero-width characters */ + if (ZERO_WIDTH_CHAR (wc)) { set_glyph (font, glyphs, i, p - text, 0); } diff --git a/modules/basic/basic-ft2.c b/modules/basic/basic-ft2.c index e16a5e29..ffff113f 100644 --- a/modules/basic/basic-ft2.c +++ b/modules/basic/basic-ft2.c @@ -29,6 +29,25 @@ #define SCRIPT_ENGINE_NAME "BasicScriptEngineFT2" + +/* 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)) + + static PangoEngineRange basic_ranges[] = { /* Basic Latin, Latin-1 Supplement, Latin Extended-A, Latin Extended-B, * IPA Extensions @@ -212,7 +231,7 @@ basic_engine_shape (PangoFont *font, if (pango_get_mirror_char (wc, &mirrored_ch)) wc = mirrored_ch; - 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 1d01f64a..ce49a6cd 100644 --- a/modules/basic/basic-x.c +++ b/modules/basic/basic-x.c @@ -25,6 +25,25 @@ #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)) + + typedef struct _CharRange CharRange; typedef struct _Charset Charset; typedef struct _CharsetOrdering CharsetOrdering; @@ -529,7 +548,7 @@ basic_engine_shape (PangoFont *font, input = buf; } - 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-xft.c b/modules/basic/basic-xft.c index 6552a347..0d2ea653 100644 --- a/modules/basic/basic-xft.c +++ b/modules/basic/basic-xft.c @@ -26,6 +26,25 @@ #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)) + + static PangoEngineRange basic_ranges[] = { /* Language characters */ { 0x0380, 0x058f, "*" }, @@ -142,7 +161,7 @@ basic_engine_shape (PangoFont *font, input = buf; } - if (wc >= 0x200B && wc <= 0x200F) /* Zero-width characters */ + if (ZERO_WIDTH_CHAR (wc)) { set_glyph (font, glyphs, i, p - text, 0); } |