Qt 4 synthesizes Helvetica font on Windows?
-
When I build and run the following code with Qt 4.8 on Windows :
@
#include <QApplication>
#include <QFontDatabase>
#include <QFontInfo>
#include <QDebug>
#include <QPainter>
#include <QImage>int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFont f("Helvetica");
QFontDatabase fdb;
qDebug() << fdb.families().indexOf("Helvetica");
QImage image(100,100,QImage::Format_ARGB32);
QPainter painter(&image);
painter.setFont(f);
painter.drawText(0,0,"Helvetica");
qDebug() << fdb.families().indexOf("Helvetica");
qDebug() << fdb.isSmoothlyScalable("Helvetica") << QFontInfo(f).exactMatch() << QFontInfo(f).family();return 0;
}
@It shows this output:
@
-1
126
true true "Helvetica"
@It indicates that the font "Helvetica" was not available as exact match before I draw some text using it.
With Qt 5.3:
@
-1
-1
false false "Arial"
@which is what I expect.
Is there any way to stop Qt 4 from "synthesizing" a Helvetica font? It doesn't do this with any other fonts I tried.