42VuoRendererFonts::VuoRendererFonts(
void)
44 addFont(
"PTS55F.ttf");
45 addFont(
"PTS75F.ttf");
51void VuoRendererFonts::addFont(QString font)
55 QString fontPath = QDir(QApplication::applicationDirPath().append(
"/../Resources/").append(font)).canonicalPath();
56 if (fontPath.count() && QFontDatabase::addApplicationFont(fontPath) != -1)
62 QString fontPath = QDir(QApplication::applicationDirPath().append(
"/resources/").append(font)).canonicalPath();
63 if (fontPath.count() && QFontDatabase::addApplicationFont(fontPath) != -1)
69 QString fontPath = QDir(QApplication::applicationDirPath().append(
"/../../renderer/font/").append(font)).canonicalPath();
70 if (fontPath.count() && QFontDatabase::addApplicationFont(fontPath) != -1)
74 VUserLog(
"Error: Failed to open '%s'.", font.toUtf8().data());
122 return QFont(
fontFamily, 14, QFont::Bold,
false);
130 return QFont(
fontFamily, 12, QFont::Light,
false);
138 return QFont(
fontFamily, 14, QFont::Light,
false);
147 if (text.length() == 0)
151 p.addText(0, 0, font, text[0]);
152 return p.boundingRect().x();
160 int qtweight = font.weight();
164 else if (qtweight > 60)
167 return QString(
"font-family: %1; font-size: %2pt; font-weight: %3;")
169 .arg(font.pointSizeF())