texlive[62963] Build/source/texk/dvipdfm-x: dvipdfmx: warn if

commits+takuji at tug.org commits+takuji at tug.org
Wed Apr 6 13:55:42 CEST 2022


Revision: 62963
          http://tug.org/svn/texlive?view=revision&revision=62963
Author:   takuji
Date:     2022-04-06 13:55:42 +0200 (Wed, 06 Apr 2022)
Log Message:
-----------
dvipdfmx: warn if interpreting OFM FONTDIR as pTeX vertical writing

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/dvi.c
    trunk/Build/source/texk/dvipdfm-x/dvi.h
    trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c
    trunk/Build/source/texk/dvipdfm-x/tfm.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2022-04-06 11:45:05 UTC (rev 62962)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2022-04-06 11:55:42 UTC (rev 62963)
@@ -1,3 +1,9 @@
+2022-04-06  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* {dvi,dvipdfmx,tfm}.c, dvi.h:
+	Warn if interpreting OFM FONTDIR as pTeX vertical writing
+	with option -v.
+
 2022-03-21  Karl Berry  <karl at tug.org>
 
 	* TL'22 release.

Modified: trunk/Build/source/texk/dvipdfm-x/dvi.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dvi.c	2022-04-06 11:45:05 UTC (rev 62962)
+++ trunk/Build/source/texk/dvipdfm-x/dvi.c	2022-04-06 11:55:42 UTC (rev 62963)
@@ -386,7 +386,7 @@
   post_id_byte = ch;
   if (ch == XDV_ID || ch == XDV_ID_OLD)
     dpx_conf.compat_mode = dpx_mode_xdv_mode;
-  is_ptex = ch == DVIV_ID;
+  dvi_ptex_with_vert = is_ptex = ch == DVIV_ID;
 
   /* Make sure post_post is really there */
   current = current - 5;

Modified: trunk/Build/source/texk/dvipdfm-x/dvi.h
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dvi.h	2022-04-06 11:45:05 UTC (rev 62962)
+++ trunk/Build/source/texk/dvipdfm-x/dvi.h	2022-04-06 11:55:42 UTC (rev 62963)
@@ -31,6 +31,7 @@
 /* instantiated in dvipdfmx.c */
 extern double paper_width, paper_height;
 extern int    landscape_mode;
+extern int    dvi_ptex_with_vert;
 
 extern double get_origin (int x);
 

Modified: trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c	2022-04-06 11:45:05 UTC (rev 62962)
+++ trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c	2022-04-06 11:55:42 UTC (rev 62963)
@@ -121,6 +121,7 @@
 static double x_offset          = 72.0;
 static double y_offset          = 72.0;
 int    landscape_mode           = 0;
+int    dvi_ptex_with_vert       = 0;
 static int    translate_origin  = 0;
 
 static int has_paper_option = 0;

Modified: trunk/Build/source/texk/dvipdfm-x/tfm.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/tfm.c	2022-04-06 11:45:05 UTC (rev 62962)
+++ trunk/Build/source/texk/dvipdfm-x/tfm.c	2022-04-06 11:55:42 UTC (rev 62963)
@@ -36,6 +36,7 @@
 #include "dpxutil.h"
 
 #include "tfm.h"
+#include "dvi.h"
 
 #define TFM_FORMAT 1
 #define OFM_FORMAT 2
@@ -242,6 +243,7 @@
 
 #define FONT_DIR_HORIZ 0
 #define FONT_DIR_VERT  1
+#define FONT_DIR_RT    5
 
 struct font_metric
 {
@@ -631,7 +633,16 @@
   tfm->nfonparm = get_positive_quad(ofm_file, "OFM", "nfonparm");
   tfm->fontdir  = get_positive_quad(ofm_file, "OFM", "fontdir");
   if (tfm->fontdir) {
-    WARN("I may be interpreting a font direction incorrectly.");
+#ifndef WITHOUT_ASCII_PTEX
+    if (dvi_ptex_with_vert && tfm->fontdir==FONT_DIR_RT && tfm->level==1 && tfm->ec>=0x2E00) {
+      /* interpret FONTDIR RT as pTeX vertical writing */
+      if (dpx_conf.verbose_level > 0)
+        WARN("I will interpret a font direction as pTeX vertical writing.");
+    } else
+#endif /* !WITHOUT_ASCII_PTEX */
+    {
+      WARN("I may be interpreting a font direction incorrectly.");
+    }
   }
   if (tfm->level == 0) {
     ofm_check_size_one(tfm, ofm_file_size);



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