texlive[56206] Build/source/texk/web2c: pdvitype.ch: support dtou

commits+hironobu at tug.org commits+hironobu at tug.org
Sat Aug 29 17:03:51 CEST 2020


Revision: 56206
          http://tug.org/svn/texlive?view=revision&revision=56206
Author:   hironobu
Date:     2020-08-29 17:03:51 +0200 (Sat, 29 Aug 2020)
Log Message:
-----------
pdvitype.ch: support dtou direction etc.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/pdvitype.ch
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/updvitype.ch

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2020-08-29 01:14:01 UTC (rev 56205)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2020-08-29 15:03:51 UTC (rev 56206)
@@ -1,3 +1,8 @@
+2020-08-29  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* pdvitype.ch: Support dtou direction. Strict check for DVI ID
+	with command 255. Version p0.5.
+
 2020-05-17  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* ppltotf.ch: Avoid compiler warnings: equality comparison with

Modified: trunk/Build/source/texk/web2c/ptexdir/pdvitype.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/pdvitype.ch	2020-08-29 01:14:01 UTC (rev 56205)
+++ trunk/Build/source/texk/web2c/ptexdir/pdvitype.ch	2020-08-29 15:03:51 UTC (rev 56206)
@@ -1,6 +1,7 @@
 % This is a change file for DVItype.
 %
 % 09/27/95 (KA)  Supporting ASCII pTeX
+% 2020-08-24 (HY)  Support \dtou
 %
 @x
 @d my_name=='dvitype'
@@ -7,7 +8,7 @@
 @d banner=='This is DVItype, Version 3.6' {printed when the program starts}
 @y
 @d my_name=='pdvitype'
- at d banner=='This is pDVItype, Version 3.6-p0.4'
+ at d banner=='This is pDVItype, Version 3.6-p0.5'
   {printed when the program starts}
 @z
 
@@ -212,11 +213,29 @@
 % pTeX
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 @x
+@!hhh:integer; {|h|, rounded to the nearest pixel}
+ at y
+@!hhh,@!vvv:integer; {|h|,|v| rounded to the nearest pixel}
+ at z
+
+ at x
 s:=0; h:=0; v:=0; w:=0; x:=0; y:=0; z:=0; hh:=0; vv:=0;
 @y
 s:=0; h:=0; v:=0; w:=0; x:=0; y:=0; z:=0; hh:=0; vv:=0; dd:=0;
 @z
 
+ at x
+move_right: @<Finish a command that sets |h:=h+q|, then |goto done|@>;
+ at y
+move_right:
+  if dd=0 then begin
+    @<Finish a command that sets |h:=h+q|, then |goto done|@>;
+  end else begin
+    if dd=1 then p:=q else {if dd=3 then} p:=-q;
+    @<Finish a command that sets |v:=v+p|, then |goto done|@>;
+  end;
+ at z
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % pTeX
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -266,11 +285,31 @@
 @x
   @t\4@>@<Cases for commands |nop|, |bop|, \dots, |pop|@>@;
 @y
-  dir: begin major('dir ',p:1); dd:=p; goto done;
+  dir: begin
+    if not ptex_p then bad_dvi('dir command within normal dvi file');
+    major('dir ',p:1); dd:=p; goto done;
     end;
   @t\4@>@<Cases for commands |nop|, |bop|, \dots, |pop|@>@;
 @z
 
+ at x
+@!vvv:integer; {|v|, rounded to the nearest pixel}
+ at y
+@!vvv,hhh:integer; {|v|,|h| rounded to the nearest pixel}
+ at z
+
+ at x
+move_down: @<Finish a command that sets |v:=v+p|, then |goto done|@>;
+ at y
+move_down:
+  if dd=0 then begin
+    @<Finish a command that sets |v:=v+p|, then |goto done|@>;
+  end else begin
+    if dd=1 then q:=-p else {if dd=3 then} q:=p;
+    @<Finish a command that sets |h:=h+q|, then |goto done|@>;
+  end;
+ at z
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % pTeX
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -296,9 +335,13 @@
 @y
 @d out_space(#)==if (p>=font_space[cur_font])or(p<=-4*font_space[cur_font]) then
     begin out_text(" ");
-      if dd=0 then hh:=pixel_round(h+p) else vv:=pixel_round(v+p);
+      if dd=0 then hh:=pixel_round(h+p)
+      else if dd=1 then vv:=pixel_round(v+p)
+      else {if dd=3 then} vv:=pixel_round(v-p);
     end
-  else if dd=0 then hh:=hh+pixel_round(p) else vv:=vv+pixel_round(p);
+  else if dd=0 then hh:=hh+pixel_round(p)
+    else if dd=1 then vv:=vv+pixel_round(p)
+    else {if dd=3 then} vv:=vv-pixel_round(p);
 @z
 
 @x
@@ -306,8 +349,13 @@
   else vv:=vv+pixel_round(p);
 @y
 @d out_vmove(#)==if abs(p)>=5*font_space[cur_font] then
-     begin if dd=0 then vv:=pixel_round(v+p) else  hh:=pixel_round(h-p) end
-  else if dd=0 then vv:=vv+pixel_round(p) else hh:=hh-pixel_round(p);
+    begin if dd=0 then vv:=pixel_round(v+p)
+      else if dd=1 then hh:=pixel_round(h-p)
+      else {if dd=3 then} hh:=pixel_round(h+p);
+    end
+  else if dd=0 then vv:=vv+pixel_round(p)
+    else if dd=1 then hh:=hh-pixel_round(p)
+    else {if dd=3 then} hh:=hh+pixel_round(p);
 @z
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -339,13 +387,16 @@
 else hh:=hh+char_pixel_width(cur_font)(p);
 @y
 else if dd=0 then hh:=hh+char_pixel_width(cur_font)(p)
-     else vv:=vv+char_pixel_width(cur_font)(p);
+     else if dd=1 then vv:=vv+char_pixel_width(cur_font)(p)
+     else {if dd=3 then} vv:=vv-char_pixel_width(cur_font)(p);
 @z
 
 @x
 hh:=hh+rule_pixels(q); goto move_right
 @y
-if dd=0 then hh:=hh+rule_pixels(q) else vv:=vv+rule_pixels(q);
+if dd=0 then hh:=hh+rule_pixels(q)
+else if dd=1 then vv:=vv+rule_pixels(q)
+else {if dd=3 then} vv:=vv-rule_pixels(q);
 goto move_right
 @z
 
@@ -353,100 +404,6 @@
 % pTeX
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 @x
-@<Finish a command that sets |h:=h+q|, then |goto done|@>=
- at y
-@<Finish a command that sets |h:=h+q|, then |goto done|@>=
-if dd=0 then begin
- at z
-
- at x
-goto done
- at y
-goto done end
-else begin
-if (v>0)and(q>0) then if v>infinity-q then
-  begin error('arithmetic overflow! parameter changed from ',
- at .arithmetic overflow...@>
-    q:1,' to ',infinity-q:1);
-  q:=infinity-v;
-  end;
-if (v<0)and(q<0) then if -v>q+infinity then
-  begin error('arithmetic overflow! parameter changed from ',
-    q:1, ' to ',(-v)-infinity:1);
-  q:=(-v)-infinity;
-  end;
-hhh:=pixel_round(v+q);
-if abs(hhh-vv)>max_drift then
-  if hhh>vv then vv:=hhh-max_drift
-  else vv:=hhh+max_drift;
-if showing then if out_mode>mnemonics_only then
-  begin print(' v:=',v:1);
-  if q>=0 then print('+');
-  print(q:1,'=',v+q:1,', vv:=',vv:1);
-  end;
-v:=v+q;
-if abs(v)>max_v_so_far then
-  begin if abs(v)>max_v+99 then
-    begin error('warning: |v|>',max_v:1,'!');
- at .warning: |v|...@>
-    max_v:=abs(v);
-    end;
-  max_v_so_far:=abs(v);
-  end;
-goto done
-end
- at z
-
- at x
-@ @<Finish a command that sets |v:=v+p|, then |goto done|@>=
- at y
-@ @<Finish a command that sets |v:=v+p|, then |goto done|@>=
-if dd=0 then begin
- at z
-
- at x
-goto done
- at y
-goto done end
-else begin
-p:=-p;
-if (h>0)and(p>0) then if h>infinity-p then
-  begin error('arithmetic overflow! parameter changed from ',
- at .arithmetic overflow...@>
-    p:1,' to ',infinity-h:1);
-  p:=infinity-h;
-  end;
-if (h<0)and(p<0) then if -h>p+infinity then
-  begin error('arithmetic overflow! parameter changed from ',
-    p:1, ' to ',(-h)-infinity:1);
-  p:=(-h)-infinity;
-  end;
-vvv:=pixel_round(h+p);
-if abs(vvv-hh)>max_drift then
-  if vvv>hh then hh:=vvv-max_drift
-  else hh:=vvv+max_drift;
-if showing then if out_mode>mnemonics_only then
-  begin print(' h:=',h:1);
-  if p>=0 then print('+');
-  print(p:1,'=',h+p:1,', hh:=',hh:1);
-  end;
-h:=h+p;
-if abs(h)>max_h_so_far then
-  begin if abs(h)>max_h+99 then
-    begin error('warning: |h|>',max_h:1,'!');
- at .warning: |h|...@>
-    max_h:=abs(h);
-    end;
-  max_h_so_far:=abs(h);
-  end;
-goto done
-end
- at z
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% pTeX
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- at x
   print('level ',ss:1,':(h=',h:1,',v=',v:1,
     ',w=',w:1,',x=',x:1,',y=',y:1,',z=',z:1,
     ',hh=',hh:1,',vv=',vv:1,')');

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2020-08-29 01:14:01 UTC (rev 56205)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2020-08-29 15:03:51 UTC (rev 56206)
@@ -1,3 +1,7 @@
+2020-08-29  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* updvitype.ch: Sync with the change of pdvitype.ch.
+
 2020-02-22  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* uptex-m.ch, upbibtex.ch, updvitype.ch, uppltotf.ch, uptftopl.ch,

Modified: trunk/Build/source/texk/web2c/uptexdir/updvitype.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/updvitype.ch	2020-08-29 01:14:01 UTC (rev 56205)
+++ trunk/Build/source/texk/web2c/uptexdir/updvitype.ch	2020-08-29 15:03:51 UTC (rev 56206)
@@ -1,9 +1,9 @@
 @x
 @d my_name=='pdvitype'
- at d banner=='This is pDVItype, Version 3.6-p0.4'
+ at d banner=='This is pDVItype, Version 3.6-p0.5'
 @y
 @d my_name=='updvitype'
- at d banner=='This is upDVItype, Version 3.6-p0.4-u1.26'
+ at d banner=='This is upDVItype, Version 3.6-p0.5-u1.26'
 @z
 
 @x procedure initialize



More information about the tex-live-commits mailing list.