Florian,

Florian Fleischer wrote
> I am using width = renderInfo.getFont().getWidth(renderInfo.getText());
> and length = topLine.getLength(); .... but I am not sure which one is the
> best to use to get the exact width of a letter or space ....

renderInfo.getFont().getWidth() returns the width in text space units.
Therefore, it does take into account neither the font size nor the current
transformation matrix.

getBaseline().getLength, on the other hand, returns the length in user space
units which does take those information into account.

I assume you need the latter information.

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Get-exact-width-of-letter-or-space-tp4657743p4657745.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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