Unsolved Different font pixel metrics in different devices.
-
Hi!
When I execute this code in Windows
QFont f = QFont("Verdana"); f.setPixelSize(18); QFontMetrics fm(f); int pixelsWidth = fm.width("What's the width of this text?What's the width of this text?"); int pixelsHeight = fm.height(); qDebug() << "Width: " << pixelsWidth; qDebug() << "Height: " << pixelsHeight;
I Obtain:
Width: 528;
Height: 22;When executed on Android:
Width: 458
Height: 21If I load the font as a ".ttf"
fontId = QFontDatabase::addApplicationFont(":/fonts/verdana/verdana");
On windows I get:
Width: 528
Height: 22On Android:
Width: 534
Height: 22Is Qt using a different font rendering engine for different platforms? Is there any way to obtain the same pixel size for both devices?
thanks!!
Xavierll