[DVIPDFMx] (e)-upTeX support in dvipdfmx

Karl Berry karl at freefriends.org
Fri Sep 9 08:01:19 KST 2011


    Attached 20110311-tltrunk.diff.gz is the difference between
    the snapshot 20110311 and the present TeX Live trunk.
    Changes for (e)-upTeX, by Tanaka Takuji san, are in dvi.c,
    spc_pdfm.c, tfm.c and vf.c. Other ones are by Peter B.

As I wrote to Akira, it would be very desirable to have the (e)upTeX
support included by default.  Otherwise we have to provide two binaries
which seems like unnecessary pain for everyone.

Looking at the code for compatibility issues ..

- euptex has handling of the three-byte set3, etc., in the file formats.
  That's no problem, it was just an error before.

- euptex reencodes to UTF-8 "sometimes".  Can't understand exactly when,
  but anyway, I doubt that will be undesirable for current dvipdfmx users.

- then there is this change:
+#if defined(upTeX)
+#if !defined(WITHOUT_ASCII_PTEX)
+#define INDEX(i)  ((i>0xFFFFul ? 0x10000ul : i))
+#else
 ...
+#if defined(upTeX)
+    return map->indices[INDEX(charcode - map->coverage.first_char)];
+#else
     return map->indices[charcode - map->coverage.first_char];
+#endif

   It seems this only makes a difference with large chars that aren't
   handled now anyway, so again, it should be ok.
   
Akira and all, do you concur?  Or am I missing compatibility problems?

In terms of coding maintenance, it seems to me it would be cleanest to
avoid all these #ifdef's and complicated mixed conditionals and just
have the euptex support in there as the mainline code.  Maybe with
comments :).


Also (minor), it seems like asking for trouble to use such a common name
as "INDEX" as a macro name.  Yes, it "should" work, but ... aside from
potential compilation issues on broken platforms, it's also meaningless.
Maybe CHAR_INDEX?

Also (minor):
-  char buf[512];
 ...
+  char buf[1024];

Replacing one fixed size array with another seems pretty ugly to me, but
barring dynamic allocation, at least increase it a lot more, IMHO.  If
it had to be increased once, that makes it pretty likely it'll need to
be increased again, in my experience.

Thanks,
Karl


More information about the dvipdfmx mailing list