[Qt-interest] How can I use QFontMetrics to measure strings which contains non-ASCII characters?

Thiago Macieira thiago at kde.org
Wed Jan 19 13:43:07 CET 2011


On Wednesday, 19 de January de 2011 10:58:39 Nikos Chantziaras wrote:
> On 01/19/2011 10:40 AM, Kermit Mei wrote:
> > 2011/1/19 Willem Liu <wliu at infologic.nl <mailto:wliu at infologic.nl>>
> > 
> >     Hi Kermit,
> >     
> >     In what way did you find it inaccurate?
> > 
> > Use the same length of string with Chinese characters. But the result is
> > different.
> 
> Well, every character has a different size.  For example the width of
> "AB" is different than the width of "BC".  Only fixed-width fonts (like
> Courier and such) have the same width for every character.

And even then there is such thing as full-width, half-width and zero-width 
characters. CJK is full-width, Latin script is half-width.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110119/655854b3/attachment.bin 


More information about the Qt-interest-old mailing list