font looks bolder in pdf than in AIR

34 views
Skip to first unread message

Mat

unread,
Jun 23, 2012, 8:26:10 AM6/23/12
to purepdf-discuss
I have a AIR application that renders a presentation. Now I need to
export this presentation into a PDF and use purePDF for this purpose.

The problem is the fontrendering. one of the fonts looks a lot bolder
in the pdf than if the application shows the presentation directly.

i embed and use the font for the realtime display like this:

[Embed(source="_embed/fonts/LT_54932.ttf", mimeType="application/x-
font", fontName="LightRegular", fontWeight="normal")] public var
LIGHT_REGULAR:Class;
then i create a new textformat and set myTextFormat.font to
"LightRegular" and apply it to my Textfield.

And the same font to be used in the pdf I embed and use like this:

[Embed(source="_embed/fonts/LT_54932.ttf", mimeType="application/octet-
stream")] public var LIGHT_REGULAR_FILE:Class;
...
FontsResourceFactory.getInstance().registerFont("lightRegular.ttf",
new LIGHT_REGULAR_FILE());
_lightRegularBf = BaseFont.createFont("lightRegular.ttf",
BaseFont.IDENTITY_H, BaseFont.EMBEDDED );
_textFont= new Font(-1, 12, -1, new RGBColor(0xae,0x0e,
0x1b),_lightRegularBf);


If I open the pdf and scale it to the same size as the AIR application
window, the font in the PDF looks a lot bolder.

Anyone knows what can be the reason for this?

David Dormoy

unread,
Jun 25, 2012, 9:52:22 AM6/25/12
to purepdf...@googlegroups.com
We experienced some differences while rendering text with purePDF too.
The text looks bolder and worst for us chunks are a bit larger than the text rendered by flash and it could be cropped in the resulting PDF.
To prevent the text from being cropped we use a little trick :
We use the horizontalScaling property of the chunks like this :

var chunk:Chunk = new Chunk(spanText, font) ;
chunk.setHorizontalScaling(0.989);

This fix the crop issue but not fix the bolder font issue.
Please let me now if you've found a solution for that.

Thanks

Best regards

Dasde
Reply all
Reply to author
Forward
0 new messages