Improve NaviCube font matching on linux

This commit is contained in:
Adrian Insaurralde Avalos
2023-02-25 13:06:49 -03:00
committed by Uwe
parent 8f36e48854
commit c6c3c54b74
2 changed files with 13 additions and 9 deletions

View File

@@ -347,6 +347,17 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
// accept drops on the window, get handled in dropEvent, dragEnterEvent
setAcceptDrops(true);
// setup font substitutions for NaviCube
// Helvetica usually gives good enough results on mac & linux
// in rare cases Helvetica matches a bad font on linux
// Nimbus Sans Narrow and Open Sans Condensed added as fallback
// Bahnschrift is a condensed font available on windows versions since 2017
// Arial added as fallback for older version
auto substitutions = QStringLiteral("Bahnschrift,Helvetica,Nimbus Sans Narrow,Open Sans Condensed,Arial,Sans");
auto family = QStringLiteral("FreeCAD NaviCube");
QFont::insertSubstitutions(family, substitutions.split(QLatin1Char(',')));
statusBar()->showMessage(tr("Ready"), 2001);
}