diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-03-14 00:49:31 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2013-03-14 00:49:31 +0000 |
commit | bf033056081d6a572b88f512a5fba4254a7e9d02 (patch) | |
tree | e1c3fccbb7c7c7d70520b3687f859c89ccb4e48f /Build/source/texk | |
parent | 0020431b31640ce7b2ce586e8cd24a7536e17751 (diff) |
Revert "Support DVI-IVD inspired text reflection for XeTeX"
We are not going to use this.
git-svn-id: svn://tug.org/texlive/trunk@29375 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/xdvipdfmx/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dvi.c | 243 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dvicodes.h | 1 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/vf.c | 8 |
4 files changed, 32 insertions, 225 deletions
diff --git a/Build/source/texk/xdvipdfmx/ChangeLog b/Build/source/texk/xdvipdfmx/ChangeLog index 720c9556c2e..b35e0d5a98f 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog +++ b/Build/source/texk/xdvipdfmx/ChangeLog @@ -1,3 +1,8 @@ +2013-03-14 Khaled Hosny <khaledhosny@eglug.org> + + * src/dvi.c, src/dvicodes.h, vf.c: Revert "Support DVI-IVD inspired text + reflection for XeTeX". + 2013-02-25 Peter Breitenlohner <peb@mppmu.mpg.de> * src/dpxutil.[ch]: Reduce diffs with dvipdfmx. diff --git a/Build/source/texk/xdvipdfmx/src/dvi.c b/Build/source/texk/xdvipdfmx/src/dvi.c index 6128652e738..a1c7f0d7106 100644 --- a/Build/source/texk/xdvipdfmx/src/dvi.c +++ b/Build/source/texk/xdvipdfmx/src/dvi.c @@ -2,8 +2,6 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2012-2013 by Khaled Hosny - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. @@ -107,25 +105,6 @@ double get_origin (int x) return x ? dev_origin_x : dev_origin_y; } -#ifdef XETEX -#define LTYPESETTING 0 /* typesetting from left to right */ -#define RTYPESETTING 1 /* typesetting from right to left */ -#define SKIMMING 2 /* skimming through reflected segment measuring its width */ -#define REVERSE(MODE) (LTYPESETTING + RTYPESETTING - MODE) - -struct dvi_lr -{ - int state, font; - unsigned long buf_index; -}; - -static struct dvi_lr lr_state; /* state at start of current skimming */ -static int lr_mode; /* current direction or skimming depth */ -static SIGNED_QUAD lr_width; /* total width of reflected segment */ -static SIGNED_QUAD lr_width_stack[DVI_STACK_DEPTH_MAX]; -static unsigned lr_width_stack_depth = 0; -#endif - #define PHYSICAL 1 #define VIRTUAL 2 #define SUBFONT 3 @@ -1133,19 +1112,8 @@ static void do_moveto (SIGNED_QUAD x, SIGNED_QUAD y) dvi_state.v = y; } -/* FIXME: dvi_forward() might be a better name */ void dvi_right (SIGNED_QUAD x) { -#ifdef XETEX - if (lr_mode >= SKIMMING) { - lr_width += x; - return; - } - - if (lr_mode == RTYPESETTING) - x = -x; -#endif - if (!dvi_state.d) { dvi_state.h += x; } else { @@ -1155,20 +1123,13 @@ void dvi_right (SIGNED_QUAD x) void dvi_down (SIGNED_QUAD y) { -#ifdef XETEX - if (lr_mode < SKIMMING) { -#endif - if (!dvi_state.d) { - dvi_state.v += y; - } else { - dvi_state.h -= y; - } -#ifdef XETEX + if (!dvi_state.d) { + dvi_state.v += y; + } else { + dvi_state.h -= y; } -#endif } -#if 0 /* Please remove this. * Optimization for 8-bit encodings. */ @@ -1226,7 +1187,6 @@ do_string (unsigned char *s, int len) dvi_state.v += width; } } -#endif /* _FIXME_ * CMap decoder wants multibyte strings as input but @@ -1255,16 +1215,6 @@ dvi_set (SIGNED_QUAD ch) width = tfm_get_fw_width(font->tfm_id, ch); width = sqxfw(font->size, width); -#ifdef XETEX - if (lr_mode >= SKIMMING) { - lr_width += width; - return; - } - - if (lr_mode == RTYPESETTING) - dvi_right(width); -#endif - switch (font->type) { case PHYSICAL: if (ch > 255) { /* _FIXME_ */ @@ -1307,17 +1257,11 @@ dvi_set (SIGNED_QUAD ch) break; } -#ifdef XETEX - if (lr_mode == LTYPESETTING) { -#endif - if (!dvi_state.d) { - dvi_state.h += width; - } else { - dvi_state.v += width; - } -#ifdef XETEX + if (!dvi_state.d) { + dvi_state.h += width; + } else { + dvi_state.v += width; } -#endif } void @@ -1390,14 +1334,12 @@ dvi_put (SIGNED_QUAD ch) void dvi_rule (SIGNED_QUAD width, SIGNED_QUAD height) { - if (width > 0 && height > 0) { - do_moveto(dvi_state.h, dvi_state.v); + do_moveto(dvi_state.h, dvi_state.v); - if (!dvi_state.d) { - pdf_dev_set_rule(dvi_state.h, -dvi_state.v, width, height); - } else { /* right ? */ - pdf_dev_set_rule(dvi_state.h, -dvi_state.v - width, height, width); - } + if (!dvi_state.d) { + pdf_dev_set_rule(dvi_state.h, -dvi_state.v, width, height); + } else { /* right ? */ + pdf_dev_set_rule(dvi_state.h, -dvi_state.v - width, height, width); } } @@ -1423,28 +1365,14 @@ do_set2 (void) static void do_setrule (void) { - SIGNED_QUAD width, height; + SIGNED_QUAD width, height; height = get_buffered_signed_quad(); width = get_buffered_signed_quad(); -#ifdef XETEX - switch (lr_mode) { - case LTYPESETTING: - dvi_rule(width, height); - dvi_right(width); - break; - case RTYPESETTING: - dvi_right(width); + if (width > 0 && height > 0) { dvi_rule(width, height); - break; - default: - lr_width += width; - break; } -#else - dvi_rule(width, height); dvi_right(width); -#endif } static void @@ -1454,22 +1382,9 @@ do_putrule (void) height = get_buffered_signed_quad (); width = get_buffered_signed_quad (); -#ifdef XETEX - switch (lr_mode) { - case LTYPESETTING: - dvi_rule(width, height); - break; - case RTYPESETTING: - dvi_right(width); + if (width > 0 && height > 0) { dvi_rule(width, height); - dvi_right(-width); - break; - default: - break; } -#else - dvi_rule(width, height); -#endif } static void @@ -1875,10 +1790,7 @@ do_xxx (UNSIGNED_QUAD size) dvi_do_special(buffer, size); RELEASE(buffer); #else -#ifdef XETEX - if (lr_mode < SKIMMING) -#endif - dvi_do_special(dvi_page_buffer + dvi_page_buf_index, size); + dvi_do_special(dvi_page_buffer + dvi_page_buf_index, size); dvi_page_buf_index += size; #endif } @@ -1968,71 +1880,6 @@ do_dir (void) #ifdef XETEX static void -lr_width_push (void) -{ - if (lr_width_stack_depth >= DVI_STACK_DEPTH_MAX) - ERROR("Segment width stack exceeded limit."); - - lr_width_stack[lr_width_stack_depth++] = lr_width; -} - -static void -lr_width_pop (void) -{ - if (lr_width_stack_depth <= 0) - ERROR("Tried to pop an empty segment width stack."); - - lr_width = lr_width_stack[--lr_width_stack_depth]; -} - -static void -dvi_begin_reflect (void) -{ - if (lr_mode >= SKIMMING) { - ++lr_mode; - } else { - lr_state.buf_index = dvi_page_buf_index; - lr_state.font = current_font; - lr_state.state = lr_mode; - lr_mode = SKIMMING; - lr_width = 0; - } -} - -static void -dvi_end_reflect (void) -{ - switch (lr_mode) { - case SKIMMING: - current_font = lr_state.font; - dvi_page_buf_index = lr_state.buf_index; - lr_mode = REVERSE(lr_state.state); /* must precede dvi_right */ - dvi_right(-lr_width); - lr_width_push(); - break; - case LTYPESETTING: - case RTYPESETTING: - lr_width_pop(); - dvi_right(-lr_width); - lr_mode = REVERSE(lr_mode); - break; - default: /* lr_mode > SKIMMING */ - lr_mode--; - } -} - -static void -do_reflect (void) -{ - UNSIGNED_BYTE value; - value = get_buffered_unsigned_byte(); - if (value == 0) - dvi_begin_reflect(); - else - dvi_end_reflect(); -} - -static void do_native_font_def (int scanning) { if (scanning) { @@ -2069,19 +1916,6 @@ do_native_font_def (int scanning) } static void -skip_glyph_array_glyphs (int yLocsPresent) -{ - unsigned int i, slen = 0; - slen = (unsigned int) get_buffered_unsigned_pair(); - for (i = 0; i < slen; i++) { - get_buffered_signed_quad(); - if (yLocsPresent) - get_buffered_signed_quad(); - get_buffered_unsigned_pair(); - } -} - -static void do_glyph_array (int yLocsPresent) { struct loaded_font *font; @@ -2096,15 +1930,6 @@ do_glyph_array (int yLocsPresent) width = get_buffered_signed_quad(); - if (lr_mode >= SKIMMING) { - lr_width += width; - skip_glyph_array_glyphs(yLocsPresent); - return; - } - - if (lr_mode == RTYPESETTING) - dvi_right(width); - slen = (unsigned int) get_buffered_unsigned_pair(); xloc = NEW(slen, spt_t); yloc = NEW(slen, spt_t); @@ -2154,12 +1979,10 @@ do_glyph_array (int yLocsPresent) RELEASE(xloc); RELEASE(yloc); - if (lr_mode == LTYPESETTING) { - if (!dvi_state.d) { - dvi_state.h += width; - } else { - dvi_state.v += width; - } + if (!dvi_state.d) { + dvi_state.h += width; + } else { + dvi_state.v += width; } return; @@ -2234,10 +2057,8 @@ dvi_do_page (long n, double hmargin, double vmargin) { unsigned char opcode; -#if 0 unsigned char sbuf[SBUF_SIZE]; unsigned int slen = 0; -#endif /* before this is called, we have scanned the page for papersize specials and the complete DVI data is now in dvi_page_buffer */ @@ -2249,7 +2070,6 @@ dvi_do_page (long n, dvi_stack_depth = 0; for (;;) { -#if 0 /* The most likely opcodes are individual setchars. * These are buffered for speed. */ slen = 0; @@ -2262,13 +2082,6 @@ dvi_do_page (long n, } if (slen == SBUF_SIZE) continue; -#endif - opcode = get_buffered_unsigned_byte(); - - if (opcode <= SET_CHAR_127) { - dvi_set(opcode); - continue; - } /* If we are here, we have an opcode that is something * other than SET_CHAR. @@ -2314,10 +2127,6 @@ dvi_do_page (long n, case PUSH: dvi_push(); -#ifdef XETEX - if (lr_mode >= SKIMMING) - lr_width_push(); -#endif /* The following line needs to go here instead of in * dvi_push() since logical structure of document is * oblivous to virtual fonts. For example the last line on a @@ -2330,10 +2139,6 @@ dvi_do_page (long n, break; case POP: dvi_pop(); -#ifdef XETEX - if (lr_mode >= SKIMMING) - lr_width_pop(); -#endif /* Above explanation holds for following line too */ dvi_mark_depth(); break; @@ -2397,9 +2202,6 @@ dvi_do_page (long n, #ifdef XETEX /* XeTeX extension */ - case XDV_REFLECT: - do_reflect(); - break; case XDV_GLYPH_STRING: do_glyph_array(0); break; @@ -2920,9 +2722,6 @@ dvi_scan_specials (long page_no, case FNT_DEF4: do_fntdef4(1); break; #ifdef XETEX - case XDV_REFLECT: - get_and_buffer_unsigned_byte(fp); - break; case XDV_GLYPH_STRING: { UNSIGNED_PAIR count; diff --git a/Build/source/texk/xdvipdfmx/src/dvicodes.h b/Build/source/texk/xdvipdfmx/src/dvicodes.h index 1495b420da7..4de92c5bd0c 100644 --- a/Build/source/texk/xdvipdfmx/src/dvicodes.h +++ b/Build/source/texk/xdvipdfmx/src/dvicodes.h @@ -122,7 +122,6 @@ #define DIR 255 /* Ascii pTeX DIR command */ #ifdef XETEX -#define XDV_REFLECT 250 /* begin/end (possiply recursive) reflected segment */ #define XDV_PIC_FILE 251 /* include graphic or PDF file */ #define XDV_NATIVE_FONT_DEF 252 /* fontdef for native platform font */ #define XDV_GLYPH_ARRAY 253 /* string of glyph IDs with X and Y positions */ diff --git a/Build/source/texk/xdvipdfmx/src/vf.c b/Build/source/texk/xdvipdfmx/src/vf.c index 883f4114f64..bfd735b8ab2 100644 --- a/Build/source/texk/xdvipdfmx/src/vf.c +++ b/Build/source/texk/xdvipdfmx/src/vf.c @@ -460,7 +460,9 @@ static void vf_putrule(unsigned char **start, unsigned char *end, spt_t ptsize) SIGNED_QUAD width, height; height = signed_quad (start, end); width = signed_quad (start, end); - dvi_rule (sqxfw(ptsize,width), sqxfw(ptsize, height)); + if (width > 0 && height > 0) { + dvi_rule (sqxfw(ptsize,width), sqxfw(ptsize, height)); + } return; } @@ -470,7 +472,9 @@ static void vf_setrule(unsigned char **start, unsigned char *end, spt_t ptsize) height = signed_quad (start, end); width = signed_quad (start, end); s_width = sqxfw(ptsize, width); - dvi_rule (s_width, sqxfw(ptsize, height)); + if (width > 0 && height > 0) { + dvi_rule (s_width, sqxfw(ptsize, height)); + } dvi_right (s_width); return; } |