[Qt-interest] Qt does not provide a way to get a font's "em" size?
Dan White
ygor at comcast.net
Thu Mar 4 16:15:44 CET 2010
OK, a bit of digging and searching, and I think I have a clue:
<http://www.clagnut.com/blog/348/>
<http://www.w3schools.com/css/css_font.asp>
My understanding from these two links is that the "em-size" is the default font size you set for your document.
Example: If you set your default font size to 20 pixels, then .75em would be 15 pixels, 2em would be 40 pixels.
In Qt context, I would use pixelSize and use the "em" value as a multiplier.
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)
----- Nikos Chantziaras <realnc at arcor.de> wrote:
> AFAIK, the x-height of a font has nothing to do with the em size. A
> fall-back for the em size would actually be pixelSize(). But it's only
> a fall-back.
>
> On 03/04/2010 04:14 PM, Dan White wrote:
> > How about using xHeight ?
> >
> > <http://doc.trolltech.com/4.6/qfontmetrics.html#xHeight>
> >
> > “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
> > Bill Waterson (Calvin& Hobbes)
> >
> > ----- Nikos Chantziaras<realnc at arcor.de> wrote:
> >> I need to get the "em" size of fonts. This is a design property of
> >> scalable fonts. QFontInfo and QFontMetrics don't seem to offer this
> >> information and I would have to use FreeType directly to query it
> >> (QFont::freetypeFace()). That's not a good solution here since the
> >> application needs to stay cross platform and still be able to get the em
> >> size.
> >>
> >> Is there any portable solution within Qt to get to that information?
> >> _______________________________________________
> >> Qt-interest mailing list
> >> Qt-interest at trolltech.com
> >> http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list