Op 22/03/2011 18:28, Sciss schreef:
> this is what it says:
>
> EncodingScheme FontSpecific

The font has a custom encoding. Passing "" as encoding is sufficient.

> the problem seems to be that fontMapper.pdfToAwt( bf, fontSize ) doesn't seem 
> to be working.

It works for me. I don't understand the problem.

>   the ttf font i had used before is installed on the system, that's why it 
> seems AWT can use, while the X11 fonts are not, and the pdfToAwt for this 
> font just returns "Dialog"...

Dialog is the default font.
Also: why is pdfToAwt important?
You only need awtToPdf don't you?

> i'm giving up here, trying to find a times-bold.ttf to download and embed. 
> cannot be that i need a whole afternoon to get my stupid chart title done. i 
> also tried to convert the crappy dfont format for the mac os standard times 
> font to ttf using Dfontsplitter, but that gives me "Table 'OS/2' does not 
> exist in /Users/hhrutz/Desktop/font_tmp/TimesBold.ttf"
>
> why is this all such a pita ?!

I don't know, I don't understand why it's a problem.

You have code that is writing to a Graphics2D object.
This code uses java.awt.Font objects.
These fonts need to be mapped to a com.itextpdf.text.pdf.BaseFont.
To achieve this, you need a FontMapper.
The method pdfToAwt can return null, you don't need it.
What you need is awtToPdf(), a method that expects a java.awt.Font (used 
to draw Strings to Graphics2D)
and that returns a com.itextpdf.text.pdf.BaseFont (needed to draw the 
String to PDF).
All of this is explained in chapter 14 of "iText in Action."

Extra hint:
When you write this method, add some logging to see which java.awt.Font 
objects are used.
That way, you know which fonts you need to map.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to