RE: Finding width of a piece of text



> -----Original Message-----
> From: me
> Sent: Wednesday, May 20, 2009 3:38 PM
> 
> The function that I wrote to get the text width is below. For the text
> "Ian Puleston" with Arial font and point size 10 it returns
> width 60416 Pango units which translates to 0.82" (60416 / 1024 / 72),
> but when that is printed the name takes just about exactly 0.75" width.

It turns out that this appears, yet again, to be a Windows bug. The debug
message that I get running the function in Windows is:

'Ian Puleston' width 60416

But when I run the exact same code in Linux it prints:

'Ian Puleston' width 56930

56930 Pango units translates to 0.77" (56930 / 1024 / 72) which is pretty
much exactly what it should be (see above).

I will report this as a Windows bug in Bugzilla.

Ian





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