diff options
author | Karl Berry <karl@freefriends.org> | 2006-12-14 00:52:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-12-14 00:52:25 +0000 |
commit | 3a618754d5304ba9b408d19f678ff523108a6845 (patch) | |
tree | 35cd149bf0a00715bdaf5c0bb8a8803e85d934b8 /Build | |
parent | 8e1e7594fd747eb9f6bec4076a85bf9a79c952aa (diff) |
update to 2.48
git-svn-id: svn://tug.org/texlive/trunk@2720 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
18 files changed, 175 insertions, 25 deletions
diff --git a/Build/source/utils/lcdf-typetools/NEWS b/Build/source/utils/lcdf-typetools/NEWS index 4483507e33e..27223e76d29 100644 --- a/Build/source/utils/lcdf-typetools/NEWS +++ b/Build/source/utils/lcdf-typetools/NEWS @@ -1,5 +1,16 @@ LCDF Typetools NEWS +Version 2.48 11.Dec.2006 + +* Translate font names into UTF-8 encoding. Reported by John Owens. + + +Version 2.47 10.Dec.2006 + +* otfinfo: Add new names, such as "Preferred Family", to 'otfinfo -i' output. + Requested by John Owens. + + Version 2.46 29.Oct.2006 * otftotfm: Base metrics files now reflect the actual base font metrics diff --git a/Build/source/utils/lcdf-typetools/README b/Build/source/utils/lcdf-typetools/README index 1e9301b5c2c..9b021dcf1a3 100644 --- a/Build/source/utils/lcdf-typetools/README +++ b/Build/source/utils/lcdf-typetools/README @@ -1,4 +1,4 @@ -LCDF-TYPETOOLS 2.46 +LCDF-TYPETOOLS 2.48 =================== USAGE diff --git a/Build/source/utils/lcdf-typetools/cfftot1/cfftot1.1 b/Build/source/utils/lcdf-typetools/cfftot1/cfftot1.1 index 46c28ad31e1..0917c946fb3 100644 --- a/Build/source/utils/lcdf-typetools/cfftot1/cfftot1.1 +++ b/Build/source/utils/lcdf-typetools/cfftot1/cfftot1.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/configure.in b/Build/source/utils/lcdf-typetools/configure.in index d2175e6ece2..b1edd0550e4 100644 --- a/Build/source/utils/lcdf-typetools/configure.in +++ b/Build/source/utils/lcdf-typetools/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(NEWS) -AM_INIT_AUTOMAKE(lcdf-typetools, 2.46) +AM_INIT_AUTOMAKE(lcdf-typetools, 2.48) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE @@ -199,9 +199,9 @@ using --without-kpathsea. dnl does it have opentype support? if test "x$enable_tetex_build" = xyes; then - AC_DEFINE(HAVE_DECL_KPSE_OPENTYPE_FORMAT) + AC_DEFINE(HAVE_DECL_KPSE_OPENTYPE_FORMAT) else - AC_CHECK_DECLS(kpse_opentype_format, :, :, [#include <kpathsea/kpathsea.h>]) + AC_CHECK_DECLS(kpse_opentype_format, :, :, [#include <kpathsea/kpathsea.h>]) fi fi AC_SUBST([KPSEINTERFACE_O]) diff --git a/Build/source/utils/lcdf-typetools/include/efont/otfname.hh b/Build/source/utils/lcdf-typetools/include/efont/otfname.hh index 5fb82fa1788..7643b66923d 100644 --- a/Build/source/utils/lcdf-typetools/include/efont/otfname.hh +++ b/Build/source/utils/lcdf-typetools/include/efont/otfname.hh @@ -19,8 +19,12 @@ class Name { public: N_POSTSCRIPT = 6, N_TRADEMARK = 7, N_MANUFACTURER = 8, N_DESIGNER = 9, N_DESCRIPTION = 10, N_VENDOR_URL = 11, N_DESIGNER_URL = 12, N_LICENSE_DESCRIPTION = 13, - N_LICENSE_URL = 14 }; - enum Platform { P_UNICODE = 0, P_MACINTOSH = 1, P_MICROSOFT = 3 }; + N_LICENSE_URL = 14, N_PREF_FAMILY = 16, + N_PREF_SUBFAMILY = 17, N_MAC_COMPAT_FULLNAME = 18, + N_SAMPLE_TEXT = 19, N_POSTSCRIPT_CID = 20 }; + enum Platform { P_UNICODE = 0, P_MACINTOSH = 1, P_MICROSOFT = 3, + E_MS_UNICODE_BMP = 1, E_MAC_ROMAN = 0, + L_MS_ENGLISH_AMERICAN = 0x409 }; enum { HEADER_SIZE = 6, NAMEREC_SIZE = 12 }; typedef uint8_t namerecord_t[NAMEREC_SIZE]; @@ -34,6 +38,7 @@ class Name { public: inline const_iterator begin() const; inline const_iterator end() const; String name(const_iterator) const; + String utf8_name(const_iterator) const; String english_name(int nameid) const; // check version string for backwards compatibility @@ -119,8 +124,8 @@ inline bool Name::EnglishPlatformPred::operator()(const namerecord_t &i) const { if (_nameid == nameid(i)) { int p = platform(i), e = encoding(i), l = language(i); - return (p == P_MACINTOSH && e == 0 && l == 0) - || (p == P_MICROSOFT && e == 1 && l == 0x409); + return (p == P_MACINTOSH && e == E_MAC_ROMAN && l == 0) + || (p == P_MICROSOFT && e == E_MS_UNICODE_BMP && l == L_MS_ENGLISH_AMERICAN); } else return false; } diff --git a/Build/source/utils/lcdf-typetools/include/lcdf/straccum.hh b/Build/source/utils/lcdf-typetools/include/lcdf/straccum.hh index eea4a2daa9d..e6c6422d2af 100644 --- a/Build/source/utils/lcdf-typetools/include/lcdf/straccum.hh +++ b/Build/source/utils/lcdf-typetools/include/lcdf/straccum.hh @@ -41,6 +41,7 @@ class StringAccum { public: inline void append(char); inline void append(unsigned char); + inline void append_utf8(uint32_t); inline void append(const char *, int); inline void append(const char *begin, const char *end); inline void append(const unsigned char *, int); @@ -69,7 +70,8 @@ class StringAccum { public: void make_out_of_memory(); inline void safe_append(const char *, int); bool grow(int); - void erase() { _s = 0; _len = 0; _cap = 0; } + inline void erase(); + void append_utf8_hard(uint32_t); StringAccum(const StringAccum &); StringAccum &operator=(const StringAccum &); @@ -122,6 +124,15 @@ StringAccum::append(char c) append(static_cast<unsigned char>(c)); } +inline void +StringAccum::append_utf8(uint32_t ch) +{ + if (ch < 0x80) + append((unsigned char) ch); + else + append_utf8_hard(ch); +} + inline char * StringAccum::reserve(int hm) { @@ -174,6 +185,14 @@ StringAccum::append(const char *begin, const char *end) make_out_of_memory(); } +inline void +StringAccum::erase() +{ + _s = 0; + _len = 0; + _cap = 0; +} + inline unsigned char * StringAccum::take_bytes() { diff --git a/Build/source/utils/lcdf-typetools/libefont/otfname.cc b/Build/source/utils/lcdf-typetools/libefont/otfname.cc index d6096b7b921..58de17610f7 100644 --- a/Build/source/utils/lcdf-typetools/libefont/otfname.cc +++ b/Build/source/utils/lcdf-typetools/libefont/otfname.cc @@ -18,6 +18,7 @@ #endif #include <efont/otfname.hh> #include <lcdf/error.hh> +#include <lcdf/straccum.hh> #include <errno.h> #include <stdlib.h> #include <string.h> @@ -27,6 +28,50 @@ namespace Efont { namespace OpenType { +static const uint16_t mac_roman_encoding[] = { + // 0x80-0x8F + 0x00C4, 0x00C5, 0x00C7, 0x00C9, // Adieresis Aring Ccedilla Eacute + 0x00D1, 0x00D6, 0x00DC, 0x00E1, // Ntilde Odieresis Udieresis aacute + 0x00E0, 0x00E2, 0x00E4, 0x00E3, // agrave acircumflex adieresis atilde + 0x00E5, 0x00E7, 0x00E9, 0x00E8, // aring ccedilla eacute egrave + // 0x90-0x9F + 0x00EA, 0x00EB, 0x00ED, 0x00EC, // ecircumflex edieresis iacute igrave + 0x00EE, 0x00EF, 0x00F1, 0x00F3, // icircumflex idieresis ntilde oacute + 0x00F2, 0x00F4, 0x00F6, 0x00F5, // ograve ocircumflex odieresis otilde + 0x00FA, 0x00F9, 0x00FB, 0x00FC, // uacute ugrave ucircumflex udieresis + // 0xA0-0xAF + 0x2020, 0x00B0, 0x00A2, 0x00A3, // dagger degree cent sterling + 0x00A7, 0x2022, 0x00B6, 0x00DF, // section bullet paragraph germandbls + 0x00AE, 0x00A9, 0x2122, 0x00B4, // registered copyright trademark acute + 0x00A8, 0x2260, 0x00C6, 0x00D8, // dieresis notequal AE Oslash + // 0xB0-0xBF + 0x221E, 0x00B1, 0x2264, 0x2265, // infinity plusminus lessequal greaterequal + 0x00A5, 0x00B5, 0x2202, 0x2211, // yen mu partialdiff summation + 0x220F, 0x03C0, 0x222B, 0x00AA, // product pi integral ordfeminine + 0x00BA, 0x03A9, 0x00E6, 0x00F8, // ordmasculine Omegagreek ae oslash + // 0xC0-0xCF + 0x00BF, 0x00A1, 0x00AC, 0x221A, // questiondown exclamdown logicalnot radical + 0x0192, 0x2248, 0x2206, 0x00AB, // florin approxequal increment guillemotleft + 0x00BB, 0x2026, 0x00A0, 0x00C0, // guillemotright ellipsis nbspace Agrave + 0x00C3, 0x00D5, 0x0152, 0x0153, // Atilde Otilde OE oe + // 0xD0-0xDF + 0x2013, 0x2014, 0x201C, 0x201D, // endash emdash quotedblleft quotedblright + 0x2018, 0x2019, 0x00F7, 0x25CA, // quoteleft quoteright divide lozenge + 0x00FF, 0x0178, 0x2044, 0x20AC, // ydieresis Ydieresis fraction Euro + 0x2039, 0x203A, 0xFB01, 0xFB02, // guilsinglleft guilsinglright fi fl + // 0xE0-0xEF + 0x2021, 0x00B7, 0x201A, 0x201E, // daggerdbl middot quotesinglbase quotedblbase + 0x2030, 0x00C2, 0x00CA, 0x00C1, // perthousand Acircumflex Ecircumflex Aacute + 0x00CB, 0x00C8, 0x00CD, 0x00CE, // Edieresis Egrave Iacute Icircumflex + 0x00CF, 0x00CC, 0x00D3, 0x00D4, // Idieresis Igrave Oacute Ocircumflex + // 0xF0-0xFF + 0xF8FF, 0x00D2, 0x00DA, 0x00DB, // apple Ograve Uacute Ucircumflex + 0x00D9, 0x0131, 0x02C6, 0x02DC, // Ugrave dotlessi circumflex tilde + 0x00AF, 0x02D8, 0x02D9, 0x02DA, // macron breve dotaccent ring + 0x00B8, 0x02DD, 0x02DB, 0x02C7 // cedilla hungarumlaut ogonek caron +}; + + Name::Name(const String &s, ErrorHandler *errh) : _str(s) { @@ -68,9 +113,46 @@ Name::name(const_iterator i) const } String +Name::utf8_name(const_iterator i) const +{ + // This code can handle Microsoft Unicode BMP and Mac Roman encodings, + // but that's it + if (!(i < end())) + return String(); + int stringOffset = USHORT_AT(_str.data() + 4); + int length = USHORT_AT(reinterpret_cast<const uint8_t *>(i) + 8); + int offset = USHORT_AT(reinterpret_cast<const uint8_t *>(i) + 10); + if (stringOffset + offset + length > _str.length()) + return String(); + const char *begins = _str.data() + stringOffset + offset; + const char *ends = begins + length; + if (platform(*i) == P_MICROSOFT && encoding(*i) == E_MS_UNICODE_BMP) { + StringAccum sa; + for (const char *s = begins; s + 1 < ends; s += 2) + sa.append_utf8(USHORT_AT(s)); + return sa.take_string(); + } else if (platform(*i) == P_MACINTOSH && encoding(*i) == E_MAC_ROMAN) { + StringAccum sa; + for (const char *s = begins; s < ends; s++) + if ((unsigned char) *s >= 0x80) { + sa.append(begins, s); + sa.append_utf8(mac_roman_encoding[*s & 0x7F]); + begins = s + 1; + } + if (!sa) + return _str.substring(begins, ends); + else { + sa.append(begins, ends); + return sa.take_string(); + } + } else + return _str.substring(begins, ends); +} + +String Name::english_name(int nameid) const { - return name(std::find_if(begin(), end(), EnglishPlatformPred(nameid))); + return utf8_name(std::find_if(begin(), end(), EnglishPlatformPred(nameid))); } bool diff --git a/Build/source/utils/lcdf-typetools/liblcdf/straccum.cc b/Build/source/utils/lcdf-typetools/liblcdf/straccum.cc index 339628861e3..1f4020cfce4 100644 --- a/Build/source/utils/lcdf-typetools/liblcdf/straccum.cc +++ b/Build/source/utils/lcdf-typetools/liblcdf/straccum.cc @@ -81,6 +81,27 @@ StringAccum::grow(int want) return true; } +void +StringAccum::append_utf8_hard(uint32_t ch) +{ + if (ch < 0x80) + append((unsigned char) ch); + else if (ch < 0x800) { + append((unsigned char) (0xC0 + ((ch >> 6) & 0x1F))); + append((unsigned char) (0x80 + (ch & 0x3F))); + } else if (ch < 0x10000) { + append((unsigned char) (0xE0 + ((ch >> 12) & 0x0F))); + append((unsigned char) (0x80 + ((ch >> 6) & 0x3F))); + append((unsigned char) (0x80 + (ch & 0x3F))); + } else if (ch < 0x110000) { + append((unsigned char) (0xF0 + ((ch >> 18) & 0x07))); + append((unsigned char) (0x80 + ((ch >> 12) & 0x3F))); + append((unsigned char) (0x80 + ((ch >> 6) & 0x3F))); + append((unsigned char) (0x80 + (ch & 0x3F))); + } else + append((unsigned char) '?'); +} + const char * StringAccum::c_str() { diff --git a/Build/source/utils/lcdf-typetools/mmafm/mmafm.1 b/Build/source/utils/lcdf-typetools/mmafm/mmafm.1 index bd1ab4bed98..db1f3264fd3 100644 --- a/Build/source/utils/lcdf-typetools/mmafm/mmafm.1 +++ b/Build/source/utils/lcdf-typetools/mmafm/mmafm.1 @@ -1,5 +1,5 @@ .\" -*-nroff-*- -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/mmpfb/mmpfb.1 b/Build/source/utils/lcdf-typetools/mmpfb/mmpfb.1 index 51ade36bc55..dc13d53aa9d 100644 --- a/Build/source/utils/lcdf-typetools/mmpfb/mmpfb.1 +++ b/Build/source/utils/lcdf-typetools/mmpfb/mmpfb.1 @@ -1,5 +1,5 @@ .\" -*-nroff-*- -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.1 b/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.1 index 16effec25a0..d4ebd306406 100644 --- a/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.1 +++ b/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.1 @@ -1,5 +1,5 @@ '\"t -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.cc b/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.cc index 0bd94901d02..c76321b117e 100644 --- a/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.cc +++ b/Build/source/utils/lcdf-typetools/otfinfo/otfinfo.cc @@ -358,6 +358,14 @@ do_info(const OpenType::Font &otf, ErrorHandler *errh, ErrorHandler *result_errh sa << "Full name: " << s << "\n"; if (String s = name.english_name(OpenType::Name::N_POSTSCRIPT)) sa << "PostScript name: " << s << "\n"; + if (String s = name.english_name(OpenType::Name::N_POSTSCRIPT_CID)) + sa << "PostScript CID name: " << s << "\n"; + if (String s = name.english_name(OpenType::Name::N_PREF_FAMILY)) + sa << "Preferred family: " << s << "\n"; + if (String s = name.english_name(OpenType::Name::N_PREF_SUBFAMILY)) + sa << "Preferred subfamily: " << s << "\n"; + if (String s = name.english_name(OpenType::Name::N_MAC_COMPAT_FULLNAME)) + sa << "Mac font menu name: " << s << "\n"; if (String s = name.english_name(OpenType::Name::N_VERSION)) sa << "Version: " << s << "\n"; if (String s = name.english_name(OpenType::Name::N_UNIQUEID)) @@ -380,11 +388,13 @@ do_info(const OpenType::Font &otf, ErrorHandler *errh, ErrorHandler *result_errh sa << "License URL: " << s << "\n"; if (String s = name.english_name(OpenType::Name::N_LICENSE_DESCRIPTION)) sa << "License Description: " << s << "\n"; + if (String s = name.english_name(OpenType::Name::N_SAMPLE_TEXT)) + sa << "Sample text: " << s << "\n"; } } - if (errh->nerrors() == before_nerrors) - result_errh->message("%s", (sa ? sa.c_str() : "no designer information")); + if (errh->nerrors() == before_nerrors) + result_errh->message("%s", (sa ? sa.c_str() : "no name information")); } static void diff --git a/Build/source/utils/lcdf-typetools/otftotfm/otftotfm.1 b/Build/source/utils/lcdf-typetools/otftotfm/otftotfm.1 index 179ed4e8db9..feae43f9740 100644 --- a/Build/source/utils/lcdf-typetools/otftotfm/otftotfm.1 +++ b/Build/source/utils/lcdf-typetools/otftotfm/otftotfm.1 @@ -1,5 +1,5 @@ '\"t -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. @@ -151,11 +151,13 @@ and options. \fISignature\fR is an opaque 6-character encoding signature. .PP .B Otftotfm -also installs a version of the font suitable for printing. +also installs a font file suitable for printing. PostScript-flavored OpenType fonts are translated to Type 1 format and installed as PFB fonts; TrueType-flavored fonts are installed as is (pdftex -and pdflatex can read TrueType directly). The installation paths are as -follows; \fIPSname\fR is the font's PostScript name. +and pdflatex can read TrueType directly). However, +.B otftotfm +will not install a font file if one already exists. The installation paths +are as follows, where \fIPSname\fR is the font's PostScript name. .TS l l l . PFB TEXMF/fonts/type1/\fIvendor\fR/\fItypeface\fR/ \fIPSname\fR.pfb diff --git a/Build/source/utils/lcdf-typetools/t1dotlessj/t1dotlessj.1 b/Build/source/utils/lcdf-typetools/t1dotlessj/t1dotlessj.1 index 832624ff117..e06e3ed922d 100644 --- a/Build/source/utils/lcdf-typetools/t1dotlessj/t1dotlessj.1 +++ b/Build/source/utils/lcdf-typetools/t1dotlessj/t1dotlessj.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/t1lint/t1lint.1 b/Build/source/utils/lcdf-typetools/t1lint/t1lint.1 index e7638848de1..ffed5e8337b 100644 --- a/Build/source/utils/lcdf-typetools/t1lint/t1lint.1 +++ b/Build/source/utils/lcdf-typetools/t1lint/t1lint.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/t1reencode/t1reencode.1 b/Build/source/utils/lcdf-typetools/t1reencode/t1reencode.1 index 354c2b540ff..170eddcb06f 100644 --- a/Build/source/utils/lcdf-typetools/t1reencode/t1reencode.1 +++ b/Build/source/utils/lcdf-typetools/t1reencode/t1reencode.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/t1testpage/t1testpage.1 b/Build/source/utils/lcdf-typetools/t1testpage/t1testpage.1 index 0dc71274bff..d3436e0fae9 100644 --- a/Build/source/utils/lcdf-typetools/t1testpage/t1testpage.1 +++ b/Build/source/utils/lcdf-typetools/t1testpage/t1testpage.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. diff --git a/Build/source/utils/lcdf-typetools/ttftotype42/ttftotype42.1 b/Build/source/utils/lcdf-typetools/ttftotype42/ttftotype42.1 index 2cdadf029bb..02b7d428b1f 100644 --- a/Build/source/utils/lcdf-typetools/ttftotype42/ttftotype42.1 +++ b/Build/source/utils/lcdf-typetools/ttftotype42/ttftotype42.1 @@ -1,4 +1,4 @@ -.ds V 2.46 +.ds V 2.48 .de M .BR "\\$1" "(\\$2)\\$3" .. |