FontLab Forum
2012-02-09, 04:09:58 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the FontLab forum, read how to use it! Update: Archives from old MSN forums are now available on our forum.
 
   Home   Help Search Calendar Downloads Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1]
  Print  
Author Topic: Checked font (subsetted) will not load by Windows.  (Read 7547 times)
ritsaert
Full Member
***

Karma: +0/-0
Netherlands Netherlands

Posts: 3


« on: 2010-06-22, 02:51:56 »

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.

When fonts are viewed with a default example viewer from FreeType It shows the subsetted glyphs correctly. I tried MergeFontPackage to create a correct font or get some directions what is wrong with it. And voila.. no errors we got a new font file. Unfortunately it didn't work; better yet, the font package it created was the same byte for byte. So this did not give me the insight what was wrong with the font program plus did not yield a readable font program. I also tried TTLoadEmbedded expects a stream of an OTF file (a truetype with an OTF header in front of it). After creating just such a file in memory and getting all the bugs out it fails with a message E_ADDFONTFAILED (eg the truetype font is unpacked correctly but the Windows font manager cannot load it.

Question: - How can I determine what I need to change to the font file in order for Windows / GDI to be able to use it? - 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 (both subsets) available for download somewhere but I am not sure about the licensing implications.
Logged
olafdruemmer
Sr. Member
****

Karma: +0/-0
Posts: 5


« Reply #1 on: 2010-06-22, 04:06:17 »

If you want I can have a look at the font(s) with out internal font tool - just send them to

olaf AT druemmer TO com

and make sure to mention FontLab Forum somewhere in your email. Fonts (incomplete as they may be) as files rather than inside a PDF are preferred.

Olaf Drümmer
callas software
Logged
ritsaert
Full Member
***

Karma: +0/-0
Netherlands Netherlands

Posts: 3


« Reply #2 on: 2010-06-24, 03:00:55 »

Olaf was also unable to find anything wrong with the subsetted fonts; He did advise to see if we could change the name of the font to something other that the ABCDEF+Fontname in order to make it more unique. This did not help either. Until now I was unable to find why the Windows Font Manager returns an error when trying to load the font..
Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-0
Russian Federation Russian Federation

Posts: 439



WWW
« Reply #3 on: 2010-06-29, 08:30:22 »

May I have a look. apetrov at fontlab [dot) com
Logged
ritsaert
Full Member
***

Karma: +0/-0
Netherlands Netherlands

Posts: 3


« Reply #4 on: 2011-06-19, 09:35:32 »

I finally found out what was wrong: the font from the PDF file contained a symbol CMAP (3,0) and the name table created contained unicode names (3,1,$0409) and NOT symbol names (3,0,$0409). Just a simple mismatch that was not picked up by the font validator. after recreating a dummy font NAME table with the correct set of font names was the font usable with GDI calls.
Logged
Tags: Windows  font  embedded 
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!