summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2014-07-30 06:18:14 +0000
committerKhaled Hosny <khaledhosny@eglug.org>2014-07-30 06:18:14 +0000
commit615fd6835c5036492f633309009dc26802976042 (patch)
tree4acedc0707ab9196e67d11d0184be51ed5433a31 /Build
parent140a0deaab224b67f5831952d607e278f29261c9 (diff)
Support TeX-XeT's begin_reflect and end_reclect opcodes in dvipdfmx
git-svn-id: svn://tug.org/texlive/trunk@34774 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfm-x/dvi.c42
-rw-r--r--Build/source/texk/dvipdfm-x/dvicodes.h3
3 files changed, 20 insertions, 30 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 45e8b96f83e..50237bf6da7 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-30 Khaled Hosny <khaledhosny@eglug.org>
+
+ * dvi.c, dvicodes.h: Support TeX-XeT's begin_reflect and end_reclect
+ opcodes in dvipdfmx.
+
2014-07-29 Khaled Hosny <khaledhosny@eglug.org>
* spc_pdfm.c: remove the #ifdef ENABLE_TOUNICODE as it is always true.
diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c
index d5862eb1dc1..46fda67a708 100644
--- a/Build/source/texk/dvipdfm-x/dvi.c
+++ b/Build/source/texk/dvipdfm-x/dvi.c
@@ -106,7 +106,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 */
@@ -123,7 +122,6 @@ static int lr_mode; /* current direction o
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
@@ -1102,7 +1100,6 @@ static void do_moveto (SIGNED_QUAD x, SIGNED_QUAD 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;
@@ -1110,7 +1107,6 @@ void dvi_right (SIGNED_QUAD x)
if (lr_mode == RTYPESETTING)
x = -x;
-#endif
switch (dvi_state.d) {
case 0:
@@ -1124,9 +1120,7 @@ void dvi_right (SIGNED_QUAD x)
void dvi_down (SIGNED_QUAD y)
{
-#ifdef XETEX
if (lr_mode < SKIMMING) {
-#endif
switch (dvi_state.d) {
case 0:
dvi_state.v += y; break;
@@ -1135,9 +1129,7 @@ void dvi_down (SIGNED_QUAD y)
case 3:
dvi_state.h += y; break;
}
-#ifdef XETEX
}
-#endif
}
#if 0
@@ -1229,7 +1221,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;
@@ -1237,7 +1228,6 @@ dvi_set (SIGNED_QUAD ch)
if (lr_mode == RTYPESETTING)
dvi_right(width);
-#endif
switch (font->type) {
case PHYSICAL:
@@ -1286,9 +1276,7 @@ dvi_set (SIGNED_QUAD ch)
vf_set_char(ch, font->font_id); /* push/pop invoked */
break;
}
-#ifdef XETEX
if (lr_mode == LTYPESETTING) {
-#endif
switch (dvi_state.d) {
case 0:
dvi_state.h += width; break;
@@ -1297,9 +1285,7 @@ dvi_set (SIGNED_QUAD ch)
case 3:
dvi_state.v -= width; break;
}
-#ifdef XETEX
}
-#endif
}
void
@@ -1429,7 +1415,6 @@ do_setrule (void)
height = get_buffered_signed_quad();
width = get_buffered_signed_quad();
-#ifdef XETEX
switch (lr_mode) {
case LTYPESETTING:
dvi_rule(width, height);
@@ -1443,10 +1428,6 @@ do_setrule (void)
lr_width += width;
break;
}
-#else
- dvi_rule(width, height);
- dvi_right(width);
-#endif
}
static void
@@ -1456,7 +1437,6 @@ do_putrule (void)
height = get_buffered_signed_quad ();
width = get_buffered_signed_quad ();
-#ifdef XETEX
switch (lr_mode) {
case LTYPESETTING:
dvi_rule(width, height);
@@ -1469,9 +1449,6 @@ do_putrule (void)
default:
break;
}
-#else
- dvi_rule(width, height);
-#endif
}
static void
@@ -1845,9 +1822,7 @@ do_fnt4 (void)
static void
do_xxx (UNSIGNED_QUAD size)
{
-#ifdef XETEX
if (lr_mode < SKIMMING)
-#endif
dvi_do_special(dvi_page_buffer + dvi_page_buf_index, size);
dvi_page_buf_index += size;
}
@@ -1935,7 +1910,6 @@ do_dir (void)
pdf_dev_set_dirmode(dvi_state.d); /* 0: horizontal, 1,3: vertical */
}
-#ifdef XETEX
static void
lr_width_push (void)
{
@@ -1990,6 +1964,7 @@ dvi_end_reflect (void)
}
}
+#ifdef XETEX
static void
do_reflect (void)
{
@@ -2283,10 +2258,8 @@ 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
@@ -2299,10 +2272,8 @@ 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;
@@ -2381,6 +2352,13 @@ dvi_do_page (long n,
case XDV_PIC_FILE:
do_pic_file();
break;
+#else
+ case BEGIN_REFLECT:
+ dvi_begin_reflect();
+ break;
+ case END_REFLECT:
+ dvi_end_reflect();
+ break;
#endif
case POST:
@@ -2900,6 +2878,10 @@ dvi_scan_specials (long page_no,
get_and_buffer_bytes(fp, len);
}
break;
+#else
+ case BEGIN_REFLECT:
+ case END_REFLECT:
+ break;
#endif
case PTEXDIR:
diff --git a/Build/source/texk/dvipdfm-x/dvicodes.h b/Build/source/texk/dvipdfm-x/dvicodes.h
index 885479bb83a..5536eba108d 100644
--- a/Build/source/texk/dvipdfm-x/dvicodes.h
+++ b/Build/source/texk/dvipdfm-x/dvicodes.h
@@ -117,6 +117,9 @@
#define PADDING 223
#define PTEXDIR 255 /* Ascii pTeX DIR command */
+#define BEGIN_REFLECT 250 /* TeX-XeT begin_reflect */
+#define END_REFLECT 251 /* TeX-XeT begin_reflect */
+
/* XeTeX ".xdv" codes */
#define XDV_REFLECT 250 /* begin/end (possiply recursive) reflected segment */
#define XDV_PIC_FILE 251 /* include graphic or PDF file */