It can be done with some work. The easiest way is to use a ColumnText to
place the text at precise position. It will do all the work of simulating
bold and italic. The hard way is to do by hand what ColumnText does. To make
bold use PdfContentByte.setTextRenderingMode(), to make italic skew the text
with matrix manipulation. See PdfDocument.writeLineToContent().
You'll need the version at www.geocities.com/itextpdf.

Best Regards,
Paulo Soares

----- Original Message -----
From: "Danny Burkes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 21:54
Subject: [iText-questions] Styled fonts on a PdfContentByte


> Hello-
>
> I am using PdfContentByte to position text absolutely on a page.  I have a
> Font object that specifies a certain base font, plus a style (Font.BOLD).
> The Font object refers to a TrueType font for which no separate bold
version
> actually exists, so the BaseFont part of Font points to the .ttf file, and
> the Font itself holds the knowledge of "bold" and "italic".
>
> However, I can't see a way to render this bold text onto PdfContentByte.
> The reason is, PdfContentByte only accepts a BaseFont as a font
> specification (PdfContentByte#setFontAndSize), so, the "bold" and "italic"
> information is lost (the text renders in a "normal" typestyle).
>
> How can I render styled TrueType fonts for which no separate .ttf file
> exists on a PdfContentByte?
>
> Thank you,
>
> Danny Burkes
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The
debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to