Bug 568438 - Fontsize handling in nsSystemFontsQt.cpp breaks for fonts with pixel size set. r=dougt

This commit is contained in:
Steffen Imhof 2010-05-27 08:07:56 -07:00
parent f4f1ba94f7
commit c388a096f0

View File

@ -80,7 +80,14 @@ nsSystemFontsQt::GetSystemFontInfo(const char *aClassName, nsString *aFontName,
aFontStyle->weight = qFont.weight();
// FIXME: Set aFontStyle->stretch correctly!
aFontStyle->stretch = NS_FONT_STRETCH_NORMAL;
aFontStyle->size = qFont.pointSizeF() * float(gfxPlatform::GetDPI()) / 72.0f;
// use pixel size directly if it is set, otherwise compute from point size
if (qFont.pixelSize() != -1) {
aFontStyle->size = qFont.pixelSize();
} else {
aFontStyle->size = qFont.pointSizeF()
* float(gfxPlatform::GetDPI())
/ 72.0f;
}
return NS_OK;
}