I can now define my font file normally, and i wrote text using it in the PDF
nicely ... There is a small issue about highlighting :
When I open the generated PDF file and select the text that was drawn using
the external font, the highlighting does not select all the text height ...
It seems it detects the height wrong.
I have seen a class in PDFBox concerning highlighting ... So can I set the
right font height through it ?
Here is a PDF file sample :
http://www.4shared.com/file/192188394/a13fcfd3/test-highlight.html
Best regards ,
Hesham
--------------------------------------
Included message :
From: "Andreas Lehmkuehler" <[email protected]>
Sent: Friday, January 08, 2010 10:27 AM
To: <[email protected]>
Subject: Re: How to sent font bold or italic ?
Hi,
Hesham G. schrieb:
Hello ,
This seems an easy question, but I couldn't find an answer for it yet. I
load a font file to draw text using it, but I want to make this font
italic or bold .... How can I do that ?
PDTrueTypeFont font = PDTrueTypeFont.loadTTF( pdfFile, new File(
"fonts/georgia.TTF" ) );
font.getFontDescriptor().setItalic( true ); // Not working !!
font.getFontDescriptor().setItalicAngle(45); // Not working !!
font.getFontDescriptor().setForceBold( true ); // Not working !!
Just try to use the italic type of the wanted font. AFAIU those attributes
are only used as a description of the font and not for rendering it.
Best regards ,
Hesham
BR
Andreas Lehmkühler