-
1. Re: Subset font missing glyf table
Ellis home Oct 19, 2014 6:53 PM (in response to nickop)Just out of curiosity, do you see the Type:TrueType (CID)/ Encoding: Identity-H on the PDFs that give you trouble?
-
2. Re: Subset font missing glyf table
nickop Oct 19, 2014 7:58 PM (in response to Ellis home)No, they're plain old Ansi TrueType. I've tested a variety of fonts and it's a fairly consistent problem as long as they're TrueType. I haven't tested OpenType but Type1 seems to work fine.
I tried to paste sample data from the PDF but this forum doesn't seem to like it.
-
3. Re: Subset font missing glyf table
Ellis home Oct 20, 2014 5:47 AM (in response to nickop)You can use dropbox.com or the like and post the link here.
-
4. Re: Subset font missing glyf table
nickop Oct 20, 2014 3:32 PM (in response to Ellis home)I was referring to the objects from the PDF file. When I try to paste the font definition here it just says: "Your content could not be saved due to an error. You may have been logged out. If this problem persists please contact your system administrator."
One sample PDF is attached to a Ghostscript bug report, at http://bugs.ghostscript.com/attachment.cgi?id=11252
-
5. Re: Subset font missing glyf table
Ellis home Oct 20, 2014 4:13 PM (in response to nickop)It looks to me the problem is with the font you are using rather that the space itself (not sure if that's what you meant on your first message). When I open the PDF on Firefox I can see the warning: "Warning: Error during font loading: Required "glyf" or "loca" tables are not found". When I use another true type for the space the problem disappears.
-
6. Re: Subset font missing glyf table
nickop Oct 20, 2014 5:00 PM (in response to Ellis home)Yes that's the problem we are seeing in ttfdump too. I wasn't aware pdf.js would reveal it, that's good to know.
Could you let me know what font you used, and was it used for only the space? I don't have direct access to InDesign because I'm a programmer but we could try other fonts.
We tried a variety of fonts from the AltonaSans family, and the FocoLight-Regular font that our client used also shows this problem. I can't see any similar issues on the original fonts using MS Font Validator.
-
7. Re: Subset font missing glyf table
Ellis home Oct 20, 2014 5:10 PM (in response to nickop)I used Helvetica CY just for the space. I think the problem is with the Altona Sans. On Firefox if you go to Tools/Web Developer/Web Console you'll see the warning at the bottom (tip courtesy of Sairus Pattel of Typekit here: Does anybody know why type might render strangely when viewing a PDF in Chrome, Firefox and IE?). You can use it to check what font might give you trouble.
-
8. Re: Subset font missing glyf table
nickop Oct 20, 2014 10:27 PM (in response to Ellis home)I've investigated a bit more. I'm not great at analysing fonts and haven't checked all variations but it seems to be something to do with whether any glyphs are defined for the required characters.
I've looked at a few fonts and it seems common that the space glyph is glyph 3, zero length. The .notdef glyph should be defined as glyph 0.
If the .notdef glyph has data then we're OK. If it's zero length, then we get 2 'used' characters that add up to zero length, and we get a zero-length 'glyf' table in the output.
If the resulting PDF is run through Ghostscript or Acrobat to save a new PDF, an empty glyf table is added which fixes the file structure.
-
9. Re: Subset font missing glyf table
Test Screen Name Oct 23, 2014 1:47 AM (in response to nickop)I'm inclined to agree that the file, if it as you describe is faulty because the PDF spec says TrueType tables are always required: “head,” “hhea,” “loca,” “maxp,” “cvt ,” “prep,” “glyf,” “hmtx,” and “fpgm.”
To hear from experts on the matter you might try this forum: PDF Language and Specifications
-
10. Re: Subset font missing glyf table
Test Screen Name Oct 23, 2014 1:49 AM (in response to Test Screen Name)(Though that only applies if the type of font dictionary is TrueType. For other font types it might be permitted, don't know).
-
11. Re: Subset font missing glyf table
nickop Oct 23, 2014 3:23 AM (in response to Test Screen Name)Thank you, I might check that forum later I did have a thought, maybe some programmers would think a zero length table satisfies the criteria of 'included', after all it is in the header with an offset! It just happens to be shared with another table.
-
12. Re: Subset font missing glyf table
Test Screen Name Oct 23, 2014 3:25 AM (in response to nickop)If the table is in the header and has zero length that sounds entirely correct. It wouldn't be shared, it's just that the next table would start at the same offset. It would only be wrong if the TrueType spec forbade zero length tables. After all, good programming practice would never reach outside the declared table length, because it might be at the end and get a buffer overrun.
-
13. Re: Subset font missing glyf table
nickop Oct 23, 2014 3:32 AM (in response to Test Screen Name)Yes I don't think it specifically forbids zero length tables, at least it doesn't mention any minimum length.
The whole thing sounds odd to me still, it seems Adobe programs are OK with it but most others are not.
-
14. Re: Subset font missing glyf table
Test Screen Name Oct 23, 2014 3:53 AM (in response to nickop)I think it would be worth raising it as an issue or bug in a GhostScript forum, to see the reaction. I think we can be sure that if it (a) is technically correct and (b) doesn't cause issues in Adobe products, then Adobe won't be motivated to do anything about it. Rather the opposite, a cynical view states.
-
15. Re: Subset font missing glyf table
nickop Oct 23, 2014 5:01 AM (in response to Test Screen Name)I did actually raise a bug when I wasn't sure where the issue lied, but the whole conversation was a little confused as I didn't fully understand what was happening. The bug report is at Bug 695605 – PDF reports missing glyphs after running through pdfwrite
The most important part of Ken's reply is "The embedded font contains no actual glyph programs, which is illegal. The Microsoft Font Validator raises this as an error (at the very least GID 0 must be defined)." I would agree, but it seems MS and Adobe disagree on this point I don't know how to get in touch with Adobe support so here I am on the forum.


