Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6016951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:03:29+00:00 2026-05-23T03:03:29+00:00

I am trying to render PDF content to a GDI device context (a 24bit

  • 0

I am trying to render PDF content to a GDI device context (a 24bit bitmap to be exact). Parsing the PDF stream into PDF objects and rendering the PDF commands from the content dictionary works well, including font rendering.

Embedded fonts are decompressed from their FontFile streams and “loaded” using AddFontMemResourceEx. Now some embedded fonts remove some TrueType tables that are needed by GDI, like the ‘name’ table. Because of this, I tried to modify the font by parsing the TrueType subset font into it’s tables and modify those tables that have data missing / missing tables are regenerated with as correct information as possible.

I use the Microsoft Font Validator tool to see how “correct” the generated font is. I still get a few errors, like for the maxp table the max values are usually too large (it is a subset) or the xAvgCharWidth field does not equal the calculated value of the ‘OS/2’ table is not correct but this does not stop other embedded fonts to be useable. The fonts embedded using PDFCreator are the ones that are problematic.

Questions:

  1. How can I determine what I need to
    change to the font file in order for
    GDI to be able to use it?
  2. Are there any other font validation
    tools that might give me insight
    into what is still wrong with the
    fontfile?

If needed: I can make an original fontfile and an altered fontfile available for download somewhere.

What modifications are made so far:

  • Make sure there is a ‘head’, ‘hhea’, ‘maxp’ and ‘OS/2’ section.
  • If we have a symbol font, clear out Panose and Unicode fields in the ‘OS/2’ section
  • Fill in correct values for WInAscent/Desc and TypoAsc/Desc if they we’re zero.
  • Fill in acceptable values for super/subscript/underline positions and sizes.
  • Scan all glyphs that are left en fill in X/Y min/max values in head.
  • Rebuild the name section with information from the PDF file it came from.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:03:30+00:00Added an answer on May 23, 2026 at 3:03 am

    Almost a year late, but I found the answer:

    The font kind (symbol or not) should be the same for the ‘cmap’ table and the ‘name’ table. So if the cmap has a 3,0,4 cmap (MS, symbol, segment delta coding) and the name table contains 3,1,$0409 (MS, Unicode, enUS) entries, the font will not load.

    It looks like the presence of a ‘symbol cmap’ determines if the font is considered a symbol font by Windows; flags in ‘OS/2’ don’t seem to matter.

    So if a font seems correct using ‘Microsoft Font Validator’, check if the symbol/unicode fields line up in the ‘cmap’ and ‘name’ tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render a user control into a string. The application is
I'm trying to render a colored cube after rendering other cubes that have textures.
I am trying to emphasize a character of some static text to render into
I'm trying to render Pdfs pages into png files using Ghostscript v9.02. For that
Im trying to render PDF pages to images on a background thread, is there
I'm trying to render a CGPDFPage (selected from a CGPDFDocument) into a UIImage to
I'm trying to get ghostscript to render a pdf file from a Windows box.
I'm trying to render a pdf (with pdf-renderer or jpedal), and it can't handle
Im trying to render a django template from a database outside of djangos normal
I am trying to render a model in Direct3D using DrawIndexedPrimitives . However, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.