summaryrefslogtreecommitdiff
path: root/pcl/pctpm.h
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2011-03-11 07:10:56 +0000
committerHenry Stiles <henry.stiles@artifex.com>2011-03-11 07:10:56 +0000
commit0a7744c48ac93fd6bb6093a984b957671ffe8e08 (patch)
treea54bdc81a1b65ca96ce169cf0016f696f309e6da /pcl/pctpm.h
parentf2197176ece890dc9595e53327c5b840164ebbb3 (diff)
Code to support Cyrillic, Greek, Arabic, Baltic symbol sets, see the
reference bug #690706 for details. Thanks to Josef Hinteregger for writing and testing the code to support the new sets. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12278 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'pcl/pctpm.h')
-rw-r--r--pcl/pctpm.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/pcl/pctpm.h b/pcl/pctpm.h
index 37257b58b..cdab7c349 100644
--- a/pcl/pctpm.h
+++ b/pcl/pctpm.h
@@ -18,28 +18,23 @@
#include "gx.h"
-typedef struct pcl_text_parsing_method_s {
- byte min1, max1;
- byte min2, max2;
+typedef enum {
+/* http://lprng.sourceforge.net/DISTRIB/RESOURCES/DOCS/pcl5comp.pdf */
+ tpm_0_SBCS = 0,
+ tpm_21_DBCS7 = 21, /* e.g. GB_2312-80 (China), JIS_X0208-1983 (Japan), KSC_5601 (Korea) */
+ tpm_31_sjis = 31,
+ tpm_38_DBCS8 = 38,
+ tpm_83_utf8 = 83, /* http://docs.hp.com/en/5991-7956/5991-7956.pdf */
+ /* HP-UX 11i v3 International Printing Features */
+ tpm_1008_utf8 = 1008 /* http://www.lexmark.com/publications/pdfs/TRef_3Q01.pdf */
} pcl_text_parsing_method_t;
-#define pcl_char_is_2_byte(ch, tpm) \
- ( ((ch) >= (tpm)->min1) && \
- ((ch) <= (tpm)->max2) && \
- (((ch) <= (tpm)->max1) || ((ch) >= (tpm)->min2)) )
+int pcl_char_bytelen(byte ch, pcl_text_parsing_method_t tpm);
+gs_char pcl_char_get_char(pcl_text_parsing_method_t tpm, const byte ** psrc, int len);
-#define pcl_tpm_is_single_byte(tpm) ((tpm)->max1 == 0)
-
-/* Single-byte only */
-#define pcl_tpm_0_data { 0xff, 0, 0xff, 0 }
-
-/* 0x21-0xff are double-byte */
-#define pcl_tpm_21_data { 0x21, 0xff, 0x21, 0xff }
-
-/* 0x81-0x9f, 0xe0-0xfc are double-byte */
-#define pcl_tpm_31_data { 0x81, 0x9f, 0xe0, 0xfc }
-
-/* 0x80-0xff are double-byte */
-#define pcl_tpm_38_data { 0x80, 0xff, 0x80, 0xff }
+/*
+ * was 0xfffd
+ */
+#define INVALID_UC 0xffff
#endif /* pctpm_INCLUDED */