RE: Finding width of a piece of text



> -----Original Message-----
> From: Tor Lillqvist
> Sent: Thursday, May 21, 2009 1:01 AM
> 
> And please attach a complete and minimal sample program (as a single
> source file in C or Python) that exhibits the problem. 

I put together a small program to demo the problem, and it turns out that
the effect varies according to point size, and with a 12-point Arial font
Windows seems to get it correct. These are widths shown by the app for the
same text with different point sizes printed in Windows and Linux.

Pt Size  Windows  Linux
8        0.57"    0.62"
10       0.82"    0.77"
12       0.96"    0.93"
14       1.08"    1.08"
16       1.17"    1.24"
24       1.88"    1.85"
32       2.44"    2.47"

And, as an aside, the test program also revealed another problem, that
pango_layout_set_width does not seem to work in properly Windows either. The
following wraps the printout at 7.5" in Linux, but at about 2" in Windows:

pango_layout_set_width(layout, (int)(7.5 * PANGO_SCALE * 72));

I'll submit a bug report on that too.

Ian




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]