diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-10-05 06:59:01 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-10-05 06:59:01 +0000 |
commit | d9b774f1452cf490eada5d351c56e03e4f793d75 (patch) | |
tree | 62fcf09a9c78c06dc64406c0ff55f6c3a776c199 /Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc | |
parent | 71a9724cc032291e34911c0eead10c8b0801aad2 (diff) |
lcdf-typetools 2.85 (27sep10)
git-svn-id: svn://tug.org/texlive/trunk@19999 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc')
-rw-r--r-- | Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc b/Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc index 584824295a8..978be47c15b 100644 --- a/Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc +++ b/Build/source/texk/lcdf-typetools/otfinfo/otfinfo.cc @@ -18,6 +18,7 @@ #include <efont/otfgsub.hh> #include <efont/otfgpos.hh> #include <efont/otfname.hh> +#include <efont/otfos2.hh> #include <efont/cff.hh> #include <lcdf/clp.h> #include <lcdf/error.hh> @@ -106,7 +107,7 @@ usage() %<Otfinfo%> reports information about an OpenType font to standard output.\n\ Options specify what information to print.\n\ \n\ -Usage: %s [-sfzpg] [OTFFILES...]\n\n", +Usage: %s [-sfzpg | OPTIONS] [OTFFILES...]\n\n", program_name); uerrh.message("\ Query options:\n\ @@ -151,7 +152,7 @@ read_file(String filename, ErrorHandler *errh, bool warning = false) while (!feof(f)) { if (char *x = sa.reserve(8192)) { int amt = fread(x, 1, 8192, f); - sa.forward(amt); + sa.adjust_length(amt); } else { errh->xmessage((warning ? errh->e_warning : errh->e_error) + ErrorHandler::make_landmark_anno(filename), "Out of memory!"); break; @@ -396,8 +397,20 @@ do_info(const OpenType::Font &otf, ErrorHandler *errh, ErrorHandler *result_errh } } + if (String os2_table = otf.table("OS/2")) { + OpenType::Os2 os2(os2_table, errh); + if (os2.ok()) { + if (String s = os2.vendor_id()) { + while (s.length() && (s.back() == ' ' || s.back() == 0)) + s = s.substring(s.begin(), s.end() - 1); + if (s) + sa << "Vendor ID: " << s << "\n"; + } + } + } + if (errh->nerrors() == before_nerrors) - result_errh->message("%s", (sa ? sa.c_str() : "no name information")); + result_errh->message("%s", (sa ? sa.c_str() : "no information")); } static void |