[poppler] TrueType "post" table format 2.8?
Albert Astals Cid
aacid at kde.org
Thu Aug 12 11:15:21 PDT 2010
A Dijous, 12 d'agost de 2010, mpsuzuki at hiroshima-u.ac.jp va escriure:
> 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.
Yeah, that code chunk has been there "forever" so really no idea.
About the post table with version 0x00028000 is there anything i can grep over
the pdf files i have here so that if i get a match it means i have that
version?
Albert
>
> Regards,
> mpsuzuki
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
More information about the poppler
mailing list