pdf - Altering an embedded TrueType font so it will be usable by Windows GDI -


I am trying to present PDF content in the GDI device reference (to be a 24 bit bitmap exact). Parsing PDF streams in PDF Objects and fixing PDF commanding content from content dictionary, including font rendering.

Embedded fonts are uncompressed with their FontFile streams and have been "loaded" using AddFontMemResourceEx . Now some embedded fonts remove some TrueType tables that are required by GDI just like the 'name' table, due to which I tried to modify the font by parse TrueType subset fonts in the table and try to modify those tables The data missing / missing tables are reproduced with the correct information as likely as possible.

I use the tool to see how "true" is the generated font I still get some errors, such that the maximum values ​​for the maximum table are usually very large (this is a subset ) Or the xAvgCharWidth field is not equal to the calculation value of the 'OS / 2' table, but it does not stop to use other embedded fonts. Embedded fonts using PDFCreator are problematic ones.

Question:

  1. How can I determine if I need to change the font file to use GDI?
  2. Is there any other font validation tool that can give me insight into the font file that is still wrong?

If needed: I have an available fontfile available for an original fontfile and a somewhere downloaded file.

What amendments have been done so far:

  • Ensure that the head, haha, maxp and os / 2 are sections.
  • If we have a symbol font, then clean the panoose and unicode fields in the 'OS / 2' section
  • Fill the right values ​​for WINAscent / Desc and TypoAsc / Desc if They are we zero
  • Fill the acceptable values ​​for super / subscript / bottom position and sizes.
  • Scan all the glyphs which are left to fill the X / Y minute / maximum value in the head. / Li>
  • Rebuild the name section with the information found from the PDF file. In GDI + for example you can do this in memory font, such as NotTrueTypeFont

    can look for any errors.

    An option for GDI might be to try to load embedded fonts in a document / check form and again returned errors with themselves. There is only one task that supplies more information than this, and their, but I fail to see how they can be used in your situation.

    By leaving all this, have you got the opportunity to review the PDF-maker (assuming you're using an open source in opposition to commercial sources)?


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -