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

Reply via email to