Hi Jeremias, Now the result seems quite correct for Helvetica. But not for my unicode font. I guess, the values from the xml are used but further details next year. I wish everybody on this list Merry Christmas and a Happy New Year!
Regards, Georg Datterl ------ Kontakt ------ Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH: www.irs-nbg.de Willmy PrintMedia GmbH: www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -----Ursprüngliche Nachricht----- Von: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Gesendet: Donnerstag, 18. Dezember 2008 14:20 An: fop-users@xmlgraphics.apache.org Betreff: Re: AW: AW: Usage of Font.getWordWidth() FOP's internal unit is millipoints. Set fontSize in millipoints and the results will be more useful. On 18.12.2008 13:21:39 Georg Datterl wrote: > Hi Jeremias, > > I now have this code: > > FopFactory fopFactory = FopFactory.newInstance(); > fopFactory.setUserConfig(new File("fonts/fop.xconf")); FOUserAgent > foUserAgent = fopFactory.newFOUserAgent(); RendererFactory rf = new > RendererFactory(); Renderer r = rf.createRenderer(foUserAgent, > "application/pdf"); PDFRenderer pr = (PDFRenderer)r; > PDFRendererConfigurator prc = new > PDFRendererConfigurator(foUserAgent); > prc.configure(r); > pr.setupFontInfo(new FontInfo()); > FontInfo info = pr.getFontInfo(); > FontSetup.setup(info); > //// object before this line can be cached, I assume /////////////// > FontTriplet fontTriplet = info.createFontKey(fontName, > org.apache.fop.fonts.Font.STYLE_NORMAL, > org.apache.fop.fonts.Font.WEIGHT_NORMAL ); org.apache.fop.fonts.Font f > = info.getFontInstance(fontTriplet, fontSize); > f.getWordWidth("myText"); > > But: > f.getWordWidth("aaaaa") and f.getWordWidth("kkkkk") give the same result (15) > although the k's take more space (7 k's = 8 a's). > > Regards, > > Georg Datterl > Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org