hello, thanks for checking back!
i need the AWT font because the rendering is all done as a JFreeChart chart. This is a Java2D package, it doesn't know anything about PDF. So I need to convert a PDF font to AWT to use it to configure JFreeChart. As it seems this works for fonts which are regularly installed on OS X, but not for the X11 or the TeXLive fonts. For example, I found the proper Times-Bold now that matches the font i'm using in my Latex template: /usr/local/texlive/2010/texmf-dist/fonts/afm/adobe/times/ptmb8a.afm (Times Bold) Now iTextPDF doesn't complain that it cannot retrieve that font using BaseFont.createFont( ... ) but as soon as i try to get an AWT equivalent, using pdfToAwt, the returned font is just "Dialog" and hence the output renders wrong. My computer is now crunching numbers trying to build FontForge, i hope that goes right, and i can convert the afm to a ttf that i can install in the Finder which i hope makes it available to AWT, although it seems stupid to embed a copy of a standard tex font. best, -sciss- On 22 Mar 2011, at 17:50, 1T3XT BVBA wrote: > 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 ------------------------------------------------------------------------------ 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
