By Date: <-- -->
By Thread: <-- -->

BaseFont.getWidths()



MAX wrote:
> BaseFont bf = BaseFont.createFont("Helvetica", "winansi", 
> false, false, null, null);
> int widths[] = bf.getWidths();
> for (int k = 0; k < widths.length; ++k) {
>     if (widths[k] != 0)
>         widths[k] = 1000;
> }
> bf.setForceWidthsOutput(true);

Where did you find this example? Please read
the documentation that comes with the example.
If the example has a reference to the iText book
in the header, please buy the book. It's the least
you can do when using a product as iText for free.

> What means 1000? 

Glyph Space.

> What does the value refer to?

1000 units in Glyph Space correspond with
1 unit in text space.

> What is the relationship to pixels or others?

For a 12pt font 1000 units in Glyph Space
corresponds with 12pt.
For a 18pt font 1000 units in Glyph Space
corresponds with 18pt.

72 points correspond with 1 inch.

This is all explained on page 229 of the book.
Your source code snippet can be found on p267.
br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/