That's the way things work in PDF. The widths are integer where 1000 corresponds to 1 unit. In PDF the calculation is done as:
INT(569 * 1000 / 2048) = 277 -> the rounding is here 30 points will be: 277 * 30 / 1000 = 8.31 Best Regards, Paulo Soares > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Stefan Duffner > Sent: Wednesday, August 11, 2004 11:25 AM > To: [EMAIL PROTECTED] > Subject: [iText-questions] BaseFont method getWidthPoint() correct > > Hallo, > > I am using iText to determine how many words fit to a line with a > certain width. For that I am using the method getWidthPoint() of the > class BaseFont to calculate the width of a word in a defined Font. > This is working fine, until I wrote a junit Test to test if > the width is > ok for the word. I calculate the a char width manually with a tool > called FontForge (http://fontforge.sourceforge.net/) where I get > information about the width of a char in a certain Font. > > For example, I am using Arial Bold Italic 30pt and checking > the char i: > The Em size of this Font is corresponding to FontForge: 2048 > The Em width of the char i corresponding to FontForge: 569 > => calculating the width in point: 569 * 30 / 2048 = 8,3350 > (roundig to > 4th decimal <http://dict.leo.org/?p=2Ib6..&search=decimal> place > <http://dict.leo.org/?p=2Ib6..&search=place>) > > The getWidthPoint() has as result 8,3100 (roundig to 4th decimal > <http://dict.leo.org/?p=2Ib6..&search=decimal> place > <http://dict.leo.org/?p=2Ib6..&search=place>) > > Is this is a bug in iText or FontForge ? Or are there only different > roundings in both applications ? Can you give me any advice, > solution ? > Thanks in advance > > -- > Best Regards > Stefan Duffner > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
