Thanks Andreas ... I have opened the fonts folder in my operating system,
and I noticed that there is a font/font-italic/font-bold files for each font
.... It's my first time to understand this. I thought when I say
setForceBold( true ); it will automatically draw the font thicker.
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