pdftex[843]
commits+thanh at tug.org
commits+thanh at tug.org
Mon Jan 18 10:48:50 CET 2021
Revision: 843
http://tug.org/svn/pdftex?view=revision&revision=843
Author: thanh
Date: 2021-01-18 10:48:50 +0100 (Mon, 18 Jan 2021)
Log Message:
-----------
bugfix: ttf2afm does not output font names (cont.)
Modified Paths:
--------------
branches/stable/source/src/texk/web2c/pdftexdir/ttf2afm.c
Modified: branches/stable/source/src/texk/web2c/pdftexdir/ttf2afm.c
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ttf2afm.c 2021-01-17 22:39:45 UTC (rev 842)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ttf2afm.c 2021-01-18 09:48:50 UTC (rev 843)
@@ -438,13 +438,21 @@
*p = (unsigned char) get_char();
i++;
if (*p == 0 && platform_id == 3) {
- /* assume this is an UTF-16BE encoded string but contains english
- * text, which is the most common case; simply copy the 2nd byte.
- * Note: will not work for non-ascii text */
+ /* assume this is an UTF-16BE encoded string but contains latin
+ * chars, which is the most common case; simply copy the 2nd byte.
+ * Note: will not work for non-latin text */
*p = (unsigned char) get_char();
i++;
}
- p++;
+ /* sometime a UTF-16BE string will contain chars where the 1st or 2nd byte is in range (0..32) */
+ if (*p < 32
+ && *p != '\r'
+ && *p != '\n'
+ && *p != '\t'
+ )
+ ttf_warn("skip unsafe character: %i", *p);
+ else
+ p++;
}
*p = 0;
return xstrdup(buf);
More information about the pdftex-commits
mailing list.