Print Page | Close Window

Embedded TrueType Font gives wrong characters

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1269
Printed Date: 04 Apr 26 at 11:06PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Embedded TrueType Font gives wrong characters
Posted By: chandy21
Subject: Embedded TrueType Font gives wrong characters
Date Posted: 11 Nov 09 at 1:52AM

Hi all,

    I am getting some strange behavior with a document I have.

    I am selecting one of the Fonts which reports to be embedded in the Document as FontType = 4. The FontName reports as "BAAAAA+Arial-BoldMT" (which by convention of "(6 alphanum)+" should be embedded in the document). When I select that Font, or any other embedded one for that matter, the characters I draw using DrawText() come out as totally different characters.

    The same code works fine in other documents, for example the QuiclPDF Reference Guide.

    Any clues as to what could be different with this document? Font Encoding perhaps? I have tried to set that to a couple of different values to no avail.

    I am testing with the following PDF: http://help.joomla.org/ghop/feb2008/task048/joomla_15_quickstart.pdf

    For exmaple, the following sentence:

"Joomla! 1.5: Quick Start Guide"

    comes out as:

"      w L2h                               "

    Any help would be greatly appreciated,


Thanks,

Ando.






Replies:
Posted By: Ingo
Date Posted: 11 Nov 09 at 6:19AM
Hi Ando!

The pdf was made with OO 2.3 Writer - that's the problem.
Please send your bug description and the link to the Joomla-pdf
to the official support-adress. Thanks.

Cheers, Ingo


Posted By: chandy21
Date Posted: 11 Nov 09 at 6:23AM

Hi Ingo,

    Thanks for your reply. Is there a known problem with documents created by OO Writer? Is it just a matter of selecting a different Encoding? Or is this maybe a Unicode issue? I am seeing the Fonts, it just seems that the Char Glyphs don't line up when I DrawText and that I get the wrong Glyph.

Thanks in advance,

Ando.



Posted By: DELBEKE
Date Posted: 11 Nov 09 at 7:35AM
Hi Ando
 
The embedded font is probably subsetted and don't containt all the glyphs.
This is often used when you have unicoded string


Posted By: chandy21
Date Posted: 11 Nov 09 at 9:08AM

Hi Debelke,

    If I try to write the same string as is there now, it comes out with incorrect Glyphs. I extracted the text and it is correct, I then try to do DrawText() with that SAME string, and it is illegible. I have tried GetSubsetFont() also, and that only returns what I send in, so no remapping of characters. Could it be that I am somehow needing to use Unicode strings into DrawText()? I am using C# with the ActiveX library.


Thanks in advance,

Ando.



Posted By: chandy21
Date Posted: 17 Nov 09 at 4:15AM

When I extract one of these Fonts using SaveFontToFile(), the Font comes out as a 31kb file, but when I try to Load it back into a Document using AddTrueTypeFontFromFile() the function fails with a return value of 0. I am guessing the Font has problems, but it appears to display Ok in the original Document, so I am confused.


Any further thoughts?

Thanks in advance,

Ando.



Posted By: Rowan
Date Posted: 24 Nov 09 at 2:38AM
Hi Ando,

The SaveFontToFile function will only work with TrueType fonts that are fully embedded within a document. If the font is an embedded subset, then this function won't work.

Cheers,
- Rowan.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk