-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
72pix fonts are same height as 48pix or 54pix fonts #77
Comments
Forgot to mention, this was observed when using MS Sans Serif |
Sorry, I can't fix it.
are bitmap fonts. They can't be scaled to any size. Only fixed list of values are available. For example, Arial is a scalable font: #include "mainwindow.h"
#include <QFontDatabase>
#include <QDebug>
#include <QFontMetrics>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFontDatabase fonts;
QString family =
//"MS Sans Serif";
//"Arial";
"Courier";
QString style = "Normal";
QList<int> sizes = fonts.smoothSizes(family, style);
qDebug() << "Sizes for " << family << " " << style;
for (int i = 0; i < sizes.count(); i++)
{
qDebug() << sizes.at(i);
}
bool isScalable = fonts.isScalable(family, style);
bool isSmoothlyScalable = fonts.isSmoothlyScalable(family, style);
qDebug() << "isScalable: " << (isScalable ? "true" : "false");
qDebug() << "isSmoothlyScalable: " << (isSmoothlyScalable ? "true" : "false");
for (int i = 16; i <= 72; i++)
{
QFont font = fonts.font(family, style, i);
QFontMetrics metrics(font);
qDebug() << "i = " << i << ", h = " << metrics.height();
}
MainWindow w;
w.show();
return a.exec();
}
|
OK, thanks for info, I will use a scalable font then. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have noticed 2 things.
1). The font size goes to 72 max.
2). from 48 onwards, the size of the font is the same
The text was updated successfully, but these errors were encountered: