[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: How can I find the 'ex' and 'em' sizes of a font in Qt?
From: Luciano Montanaro <mikelima () cirulla ! net>
Date: 2004-10-03 10:37:14
Message-ID: 200410031237.22814.mikelima () cirulla ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
I am trying to modify a widget style so that it scales widget features in
accord with the widget font used. For example, I want the check boxes to be
scaled up when the font size is increased.
So I'd like to use font-relative measures to calculate widget features.
An 'em' is the width of a capital M, and it should be easy enough to calculate
as fontMetrics().width("M");
for the 'ex' size (the height of a lowercase 'x'), I am currently using 2 *
fontMetrics().strikeOutPos(), which is near to what I need, but it tends to
give a value a bit larger than the real one. Is there a way to obtain the
real value?
Thanks in advance,
Luciano
--
Luciano Montanaro //
\X/ mikelima@virgilio.it
[Attachment #5 (application/pgp-signature)]
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic