[poppler] TrueType "post" table format 2.8?
mpsuzuki at hiroshima-u.ac.jp
mpsuzuki at hiroshima-u.ac.jp
Thu Aug 12 00:25:33 PDT 2010
Hi,
Recently I was trying to add a feature to obtain a
TrueType glyph name for a glyph specified by GID,
for CIDFontType2 instance. Now I think it's almost
useless because most embedded TrueType fonts are
embedded without post table, but I found a strange
code in FoFiTrueType.cc.
1353 void FoFiTrueType::readPostTable() {
1354 GooString *name;
1355 int tablePos, postFmt, stringIdx, stringPos;
1356 int i, j, n, m;
1357
1358 if ((i = seekTable("post")) < 0) {
1359 return;
1360 }
....
1366 if (postFmt == 0x00010000) {
1367 nameToGID = new GooHash(gTrue);
....
1371 } else if (postFmt == 0x00020000) {
1372 nameToGID = new GooHash(gTrue);
....
1409 } else if (postFmt == 0x00028000) {
1410 nameToGID = new GooHash(gTrue);
1411 for (i = 0; i < nGlyphs; ++i) {
1412 j = getU8(tablePos + 32 + i, &parsedOk);
1413 if (!parsedOk) {
1414 return;
1415 }
1416 if (j < 258) {
1417 nameToGID->removeInt(macGlyphNames[j]);
1418 nameToGID->add(new GooString(macGlyphNames[j]), i);
1419 }
1420 }
1421 }
1422 }
This code looks like as if designed to support "post"
table format version 1.0, 2.0 and 2.8. The version 2.8
is unknown for me. According to latest OpenType spec:
http://www.microsoft.com/typography/otspec/post.htm
There are 1.0, 2.0, 2.5 and 3.0, there's no 2.8.
And, the implementation for 2.8 looks as if it was intended
to support 2.5.
# BTW, post 3.0 is just used to declare "there is no
# PostScript glyph names in this font", so there is
# no need to support post 3.0 in future poppler/xpdf.
If anybody has an example of TrueType font including
post table with version 0x00028000, please let me know
about its detail.
I'm afraid poppler maintainer don't know why 2.8 was used,
because this part had already existed in the initial version
of poppler. In addition, current xpdf (3.02) uses 2.8 too.
I will write to derekn, the original author of xpdf.
Regards,
mpsuzuki
More information about the poppler
mailing list