texlive[50114] Build/source/texk/dvipdfm-x: Allow PS glyph names in v

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Feb 24 23:07:11 CET 2019


Revision: 50114
          http://tug.org/svn/texlive?view=revision&revision=50114
Author:   kakuto
Date:     2019-02-24 23:07:11 +0100 (Sun, 24 Feb 2019)
Log Message:
-----------
Allow PS glyph names in v 2.0 post table more than 32767. (S. Hirata)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/configure
    trunk/Build/source/texk/dvipdfm-x/configure.ac
    trunk/Build/source/texk/dvipdfm-x/tt_post.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2019-02-24 15:14:11 UTC (rev 50113)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2019-02-24 22:07:11 UTC (rev 50114)
@@ -1,3 +1,10 @@
+2019-02-25  Shunsaku Hirata  <shunsaku.hirata74 at gmail.com>
+
+	* tt_post.c: Since OpenType ver. 1.7, PostScript glyph names
+	more than 32767 are allowed for version 2.0 post table. Some
+	minore fixes in chek of valid index range.
+	* configure.ac: Version 20190225.
+
 2019-02-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* tt_post.c (tt_lookup_post_table): Fix a bug that the loop

Modified: trunk/Build/source/texk/dvipdfm-x/configure
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/configure	2019-02-24 15:14:11 UTC (rev 50113)
+++ trunk/Build/source/texk/dvipdfm-x/configure	2019-02-24 22:07:11 UTC (rev 50114)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20190127.
+# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20190225.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='dvipdfm-x (TeX Live)'
 PACKAGE_TARNAME='dvipdfm-x--tex-live-'
-PACKAGE_VERSION='20190127'
-PACKAGE_STRING='dvipdfm-x (TeX Live) 20190127'
+PACKAGE_VERSION='20190225'
+PACKAGE_STRING='dvipdfm-x (TeX Live) 20190225'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1350,7 +1350,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures dvipdfm-x (TeX Live) 20190127 to adapt to many kinds of systems.
+\`configure' configures dvipdfm-x (TeX Live) 20190225 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1421,7 +1421,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20190127:";;
+     short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20190225:";;
    esac
   cat <<\_ACEOF
 
@@ -1551,7 +1551,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-dvipdfm-x (TeX Live) configure 20190127
+dvipdfm-x (TeX Live) configure 20190225
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2390,7 +2390,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by dvipdfm-x (TeX Live) $as_me 20190127, which was
+It was created by dvipdfm-x (TeX Live) $as_me 20190225, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -8077,7 +8077,7 @@
 
 # Define the identity of the package.
  PACKAGE='dvipdfm-x--tex-live-'
- VERSION='20190127'
+ VERSION='20190225'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14746,7 +14746,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-dvipdfm-x (TeX Live) config.lt 20190127
+dvipdfm-x (TeX Live) config.lt 20190225
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -16636,7 +16636,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by dvipdfm-x (TeX Live) $as_me 20190127, which was
+This file was extended by dvipdfm-x (TeX Live) $as_me 20190225, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16706,7 +16706,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-dvipdfm-x (TeX Live) config.status 20190127
+dvipdfm-x (TeX Live) config.status 20190225
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/dvipdfm-x/configure.ac
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/configure.ac	2019-02-24 15:14:11 UTC (rev 50113)
+++ trunk/Build/source/texk/dvipdfm-x/configure.ac	2019-02-24 22:07:11 UTC (rev 50114)
@@ -7,7 +7,7 @@
 dnl   gives unlimited permission to copy and/or distribute it,
 dnl   with or without modifications, as long as this notice is preserved.
 dnl
-AC_INIT([dvipdfm-x (TeX Live)], [20190127], [tex-k at tug.org])
+AC_INIT([dvipdfm-x (TeX Live)], [20190225], [tex-k at tug.org])
 AC_PREREQ([2.65])
 AC_CONFIG_SRCDIR([agl.c])
 AC_CONFIG_AUX_DIR([../../build-aux])

Modified: trunk/Build/source/texk/dvipdfm-x/tt_post.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/tt_post.c	2019-02-24 15:14:11 UTC (rev 50113)
+++ trunk/Build/source/texk/dvipdfm-x/tt_post.c	2019-02-24 22:07:11 UTC (rev 50114)
@@ -47,28 +47,42 @@
 
   indices     = NEW(post->numberOfGlyphs, USHORT);
   maxidx = 257;
-  for (i = 0;
-       i < post->numberOfGlyphs; i++) {
+  for (i = 0; i < post->numberOfGlyphs; i++) {
     idx = sfnt_get_ushort(sfont);
     if (idx >= 258) {
       if (idx > maxidx)
         maxidx = idx;
+#if 0
+  /*
+   * Apple's TrueType spec. describes as,
+   *
+   *   Index numbers 32768 through 65535 are reserved for future use.
+   *   If you do not want to associate a PostScript name with a particular
+   *   glyph, use index number 0 which points to the name .notdef.
+   *
+   *   -- https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html
+   *
+   * But there are no restriction in Microsoft's OpenType spec.
+
       if (idx > 32767) {
-	/* Although this is strictly speaking out of spec, it seems to work
-	   and there are real-life fonts that use it.
-           We show a warning only once, instead of thousands of times */
-	static char warning_issued = 0;
-	if (!warning_issued) {
-	  WARN("TrueType post table name index %u > 32767", idx);
-	  warning_issued = 1;
-	}
+        /* Although this is strictly speaking out of spec, it seems to work
+         * and there are real-life fonts that use it.
+         * We show a warning only once, instead of thousands of times
+         */
+        static char warning_issued = 0;
+        if (!warning_issued) {
+          WARN("TrueType post table name index %u > 32767", idx);
+          warning_issued = 1;
+        }
         /* In a real-life large font, (x)dvipdfmx crashes if we use
-           nonvanishing idx in the case of idx > 32767.
-           If we set idx = 0, (x)dvipdfmx works fine for the font and
-           created pdf seems fine. The post table may not be important
-           in such a case */
+         * nonvanishing idx in the case of idx > 32767.
+         * If we set idx = 0, (x)dvipdfmx works fine for the font and
+         * created pdf seems fine. The post table may not be important
+         * in such a case
+         */
         idx = 0;
       }
+#endif
     }
     indices[i] = idx;
   }
@@ -81,11 +95,11 @@
     for (i = 0; i < post->count; i++) { /* read Pascal strings */
       len = sfnt_get_byte(sfont);
       if (len > 0) {
-	post->names[i] = NEW(len + 1, char);
-	sfnt_read(post->names[i], len, sfont);
-	post->names[i][len] = 0;
+        post->names[i] = NEW(len + 1, char);
+        sfnt_read(post->names[i], len, sfont);
+        post->names[i][len] = 0;
       } else {
-	post->names[i] = NULL;
+        post->names[i] = NULL;
       }
     }
   }
@@ -163,7 +177,7 @@
 
   for (gid = 0; gid < post->numberOfGlyphs; gid++) {
     if (post->glyphNamePtr[gid] &&
-	!strcmp(glyphname, post->glyphNamePtr[gid])) {
+        !strcmp(glyphname, post->glyphNamePtr[gid])) {
       return  gid;
     }
   }
@@ -174,7 +188,7 @@
 char*
 tt_get_glyphname (struct tt_post_table *post, USHORT gid)
 {
-  if (gid < post->count && post->glyphNamePtr[gid])
+  if (gid < post->numberOfGlyphs && post->glyphNamePtr[gid])
     return xstrdup(post->glyphNamePtr[gid]);
   return NULL;
 }
@@ -191,7 +205,7 @@
   if (post->names) {
     for (i = 0; i < post->count; i++) {
       if (post->names[i])
-	RELEASE(post->names[i]);
+        RELEASE(post->names[i]);
     }
     RELEASE(post->names);
   }



More information about the tex-live-commits mailing list