15#include <qpa/qplatformintegration.h>
17#include <QtGui/private/qguiapplication_p.h>
18#include <qpa/qplatformfontdatabase.h>
19#include <qpa/qplatformtheme.h>
21#include <QtCore/qcache.h>
22#include <QtCore/qmath.h>
27#include <qtgui_tracepoints_p.h>
30#include <QtGui/private/qwindowsfontdatabasebase_p.h>
40#define SMOOTH_SCALABLE 0xffff
42#if defined(QT_BUILD_INTERNAL)
43bool qt_enable_test_font =
false;
47 qt_enable_test_font =
value;
68 if (
s ==
"normal"_L1 ||
s ==
"regular"_L1)
72 if (
s ==
"semibold"_L1 ||
s ==
"semi bold"_L1 ||
s ==
"demibold"_L1 ||
s ==
"demi bold"_L1)
83 if (
s.startsWith(
"ex"_L1) ||
s.startsWith(
"ul"_L1)) {
84 if (
s2 ==
"tralight"_L1 ||
s ==
"tra light"_L1)
86 if (
s2 ==
"trabold"_L1 ||
s2 ==
"tra bold"_L1)
92 if (
s.contains(
"bold"_L1)) {
93 if (
s.contains(
"demi"_L1))
97 if (
s.contains(
"thin"_L1))
99 if (
s.contains(
"light"_L1))
101 if (
s.contains(
"black"_L1))
111 if (
s == translatedBold)
120 if (
s == translatedLight)
132 if (
s.contains(translatedBold)) {
137 if (
s.contains(translatedExtra))
142 if (
s.contains(translatedLight)) {
143 if (
s.contains(translatedExtra))
158 if (styleString.
contains(
"Italic"_L1))
160 else if (styleString.
contains(
"Oblique"_L1))
230 if (
f.isNull() &&
count == 1)
245 foundries = newFoundries;
249 return foundries[
count++];
274 delete families[
count];
279 for (
auto &
font : applicationFonts)
280 font.properties.clear();
288 qCDebug(lcFontDb) <<
"Invalidating font database";
292 fallbacksCache.clear();
312 pos = (high + low) / 2;
318 if (!fam && (
flags & EnsureCreated)) {
328 families = newFamilies;
333 families[
pos] = family;
339 if (fam && (
flags & EnsurePopulated)) {
340 if (!fam->ensurePopulated())
350 QChar::Script_Common,
353 QChar::Script_Cyrillic,
354 QChar::Script_Armenian,
355 QChar::Script_Hebrew,
356 QChar::Script_Arabic,
357 QChar::Script_Syriac,
358 QChar::Script_Thaana,
359 QChar::Script_Devanagari,
360 QChar::Script_Bengali,
361 QChar::Script_Gurmukhi,
362 QChar::Script_Gujarati,
365 QChar::Script_Telugu,
366 QChar::Script_Kannada,
367 QChar::Script_Malayalam,
368 QChar::Script_Sinhala,
371 QChar::Script_Tibetan,
372 QChar::Script_Myanmar,
373 QChar::Script_Georgian,
378 QChar::Script_Hangul,
380 QChar::Script_Common,
405 size_t ws = writingSystem;
432 int i =
name.indexOf(u
'[');
433 int li =
name.lastIndexOf(u
']');
434 if (
i >= 0 && li >= 0 &&
i < li) {
436 if (
i > 0 &&
name[
i - 1] == u
' ')
449 if (space) *
s =
s->toUpper();
450 space =
s->isSpace();
458 if (space) *
s =
s->toUpper();
459 space =
s->isSpace();
477 family = desc.family->name;
478 if (! desc.foundry->name.isEmpty() && desc.family->count > 1)
479 family +=
" ["_L1 + desc.foundry->name + u
']';
482 if (desc.style->smoothScalable
487 fontDef->
pixelSize = desc.size->pixelSize;
495 fontDef->
weight = desc.style->key.weight;
497 fontDef->
style = desc.style->key.style;
498 fontDef->
fixedPitch = desc.family->fixedPitch;
509 for (
int i = 0,
size = family_list.size();
i <
size; ++
i)
521 db->fallbacksCache.clear();
528 return fontDatabaseMutex();
540 bool scalable,
int pixelSize,
bool fixedPitch,
544 qCDebug(lcFontDb) <<
"Adding font: familyName" << familyName <<
"stylename" << stylename <<
"weight" <<
weight
545 <<
"style" << style <<
"pixelSize" <<
pixelSize <<
"antialiased" <<
antialiased <<
"fixed" << fixedPitch;
547 styleKey.
style = style;
549 styleKey.stretch = stretch;
574 qCDebug(lcFontDb) <<
"Registering family" << familyName;
585 qCDebug(lcFontDb) <<
"Registering alias" << alias <<
"to family" << familyName;
602 for (
int i = 0;
i <
d->count; ++
i)
603 if (
d->families[
i]->matchesFamilyName(alias))
604 return d->families[
i]->name;
636 for (
int i = 0;
i <
db->count; ++
i) {
639 f->ensurePopulated();
644 for (
int j = 0;
j <
f->count; ++
j) {
647 for (
int k = 0; k < foundry->
count; ++k) {
650 :
f->name +
" ["_L1 + foundry->
name + u
']';
659 return preferredFallbacks + otherFallbacks;
673 QStringList userFallbacks =
db->applicationFallbackFontFamilies.value(script == QChar::Script_Common ? QChar::Script_Latin : script);
676 QStringList::iterator
i;
677 for (
i = retList.begin();
i != retList.end(); ++
i) {
679 for (
int j = 0;
j <
db->count;
j++) {
680 if (
db->families[
j]->matchesFamilyName(*
i)) {
686 i = retList.erase(
i);
702QFontEngine *QFontDatabasePrivate::loadSingleEngine(
int script,
713 || pfdb->fontsAlwaysScalable()) {
725 const bool cacheForCommonScript = script != QChar::Script_Common
728 if (
Q_LIKELY(cacheForCommonScript)) {
730 key.script = QChar::Script_Common;
736 qWarning(
" OpenType support missing for \"%s\", script %d",
760 if (!
engine->supportsScript(QChar::Script(script))) {
761 qWarning(
" OpenType support missing for \"%s\", script %d",
763 if (
engine->ref.loadRelaxed() == 0)
773 key.script = QChar::Script_Common;
793 if (!
request.fallBackFamilies.isEmpty()) {
802 pfMultiEngine->setFallbackFamiliesList(fallbacks);
834 for (
int i = 0;
i < foundry->
count;
i++ ) {
843 int d =
qAbs( (
int(styleKey.weight) -
int(style->
key.
weight)) / 10 );
845 if ( styleKey.stretch != 0 && style->
key.
stretch != 0 ) {
849 if (styleKey.style != style->
key.
style) {
863 qCDebug(lcFontMatch,
" best style has distance 0x%x",
dist );
864 return foundry->
styles[best];
868unsigned int QFontDatabasePrivate::bestFoundry(
int script,
unsigned int score,
int styleStrategy,
876 desc->foundry =
nullptr;
877 desc->style =
nullptr;
878 desc->size =
nullptr;
883 for (
int x = 0;
x < family->
count; ++
x) {
888 qCDebug(lcFontMatch,
" looking for matching style in foundry '%s' %d",
894 qCDebug(lcFontMatch,
" ForceOutline set, but not smoothly scalable");
905 qCDebug(lcFontMatch,
" found exact size match (%d pixels)",
size->pixelSize);
906 px =
size->pixelSize;
914 qCDebug(lcFontMatch,
" found smoothly scalable font (%d pixels)",
pixelSize);
932 for (
int x = 0;
x < style->
count; ++
x) {
952 qCDebug(lcFontMatch,
" no size supports the script we want");
968 unsigned int this_score = 0x0000;
970 PitchMismatch = 0x4000,
971 StyleMismatch = 0x2000,
972 BitmapScaledPenalty = 0x1000
977 this_score += PitchMismatch;
979 if (styleKey != style->
key)
980 this_score += StyleMismatch;
982 this_score += BitmapScaledPenalty;
986 if (this_score < score) {
987 qCDebug(lcFontMatch,
" found a match: score %x best score so far %x",
991 desc->foundry = foundry;
995 qCDebug(lcFontMatch,
" score %x no better than best %x", this_score, score);
1006 return f->matchesFamilyName(familyName);
1015 const QString &foundry_name,
QtFontDesc *desc,
const QList<int> &blacklistedFamilies,
1016 unsigned int *resultingScore)
1022 styleKey.weight =
request.weight;
1025 char pitch =
request.ignorePitch ?
'*' :
request.fixedPitch ?
'm' :
'p';
1028 qCDebug(lcFontMatch,
"QFontDatabasePrivate::match\n"
1030 " family: %s [%s], script: %d\n"
1032 " weight: %d, style: %d\n"
1036 family_name.isEmpty() ?
"-- first in script --" : family_name.toLatin1().constData(),
1037 foundry_name.isEmpty() ?
"-- any --" : foundry_name.toLatin1().constData(), script,
1041 desc->family =
nullptr;
1042 desc->foundry =
nullptr;
1043 desc->style =
nullptr;
1044 desc->size =
nullptr;
1046 unsigned int score = ~0u;
1056 for (
int x = 0;
x <
db->count; ++
x) {
1057 if (blacklistedFamilies.contains(
x))
1073 unsigned int newscore =
1074 bestFoundry(script, score,
request.styleStrategy,
1075 test.
family, foundry_name, styleKey,
request.pixelSize, pitch,
1077 if (test.
foundry ==
nullptr && !foundry_name.isEmpty()) {
1080 newscore = bestFoundry(script, score,
request.styleStrategy, test.
family,
1082 pitch, &test,
request.styleName);
1085 if (newscore < score) {
1094 if (resultingScore !=
nullptr)
1095 *resultingScore = score;
1131 return result.simplified();
1327 if (!
d->populated) {
1331 qCDebug(lcFontDb) <<
"Populating font database";
1334 qFatal(
"QFontDatabase: Must construct a QGuiApplication before accessing QFontDatabase");
1337 platformFontDatabase->populateFontDatabase();
1339 for (
int i = 0;
i <
d->applicationFonts.size();
i++) {
1340 auto *
font = &
d->applicationFonts[
i];
1341 if (!
font->isNull() && !
font->isPopulated())
1342 platformFontDatabase->addApplicationFont(
font->data,
font->fileName,
font);
1348 d->populated =
true;
1365 quint64 writingSystemsFound = 0;
1366 static_assert(WritingSystemsCount < 64);
1368 for (
int i = 0;
i <
d->count; ++
i) {
1373 if (family->
count == 0)
1375 for (
uint x = Latin;
x <
uint(WritingSystemsCount); ++
x) {
1377 writingSystemsFound |=
quint64(1) <<
x;
1384 QList<WritingSystem>
list;
1386 for (
uint x = Latin ;
x <
uint(WritingSystemsCount); ++
x) {
1387 if (writingSystemsFound & (
quint64(1) <<
x))
1402 QString familyName, foundryName;
1408 QList<WritingSystem>
list;
1410 if (!
f ||
f->count == 0)
1413 for (
int x = Latin;
x < WritingSystemsCount; ++
x) {
1438 for (
int i = 0;
i <
d->count;
i++) {
1440 if (
f->populated &&
f->count == 0)
1442 if (writingSystem != Any) {
1443 if (!
f->ensurePopulated())
1448 if (!
f->populated ||
f->count == 1) {
1449 flist.append(
f->name);
1451 for (
int j = 0;
j <
f->count;
j++) {
1475 QString familyName, foundryName;
1487 for (
int j = 0;
j <
f->count;
j++) {
1490 for (
int k = 0; k < foundry->
count; k++) {
1498 l.reserve(allStyles.count);
1499 for (
int i = 0;
i < allStyles.count;
i++) {
1500 l.append(allStyles.styles[
i]->styleName.isEmpty() ?
1503 allStyles.styles[
i]->styleName);
1518 QString familyName, foundryName;
1525 return (
f &&
f->fixedPitch);
1542 QString familyName, foundryName;
1552 for (
int j = 0;
j <
f->count;
j++) {
1555 for (
int k = 0; k < foundry->
count; k++)
1581 QString familyName, foundryName;
1589 for (
int i = 0;
i <
d->count;
i++) {
1590 if (
d->families[
i]->matchesFamilyName(familyName)) {
1592 if (
f->ensurePopulated())
1600 for (
int j = 0;
j <
f->count;
j++) {
1603 for (
int k = 0; k < foundry->
count; k++) {
1632 if (isSmoothlyScalable(family, style))
1634 return isBitmapScalable(family, style);
1648 return standardSizes();
1651 QString familyName, foundryName;
1660 if (!fam)
return sizes;
1666 for (
int j = 0;
j < fam->count;
j++) {
1670 if (!style)
continue;
1676 for (
int l = 0; l < style->
count; l++) {
1680 const int pointSize =
qRound(
size->pixelSize * 72.0 / dpi);
1681 if (!
sizes.contains(pointSize))
1682 sizes.append(pointSize);
1689 return standardSizes();
1704 QString familyName, foundryName;
1713 for (
int j = 0;
j <
f->count;
j++) {
1716 for (
int k = 0; k < foundry->
count; k++)
1729 if (!
s->styleName.isEmpty())
1730 fnt.setStyleName(
s->styleName);
1747 return standardSizes();
1750 QString familyName, foundryName;
1765 for (
int j = 0;
j < fam->count;
j++) {
1769 if (!style)
continue;
1775 for (
int l = 0; l < style->
count; l++) {
1779 const int pointSize =
qRound(
size->pixelSize * 72.0 / dpi);
1780 if (!
sizes.contains(pointSize))
1781 sizes.append(pointSize);
1814 QString familyName, foundryName;
1822 if (!
f)
return false;
1824 for (
int j = 0;
j <
f->count;
j++) {
1827 for (
int k = 0; k < foundry->
count; k++)
1847 QString familyName, foundryName;
1855 if (!
f)
return false;
1857 for (
int j = 0;
j <
f->count;
j++) {
1861 for (
int k = 0; k < foundry->
count; k++)
1882 QString familyName, foundryName;
1892 for (
int j = 0;
j <
f->count;
j++) {
1896 for (
int k = 0; k < foundry->
count; k++)
1910 QString parsedFamily, foundry;
1917 for (
int i = 0;
i <
d->count;
i++) {
1919 if (
f->populated &&
f->count == 0)
1953 const char *
name =
nullptr;
1954 switch (writingSystem) {
2030 case SimplifiedChinese:
2033 case TraditionalChinese:
2058 Q_ASSERT_X(
false,
"QFontDatabase::writingSystemName",
"invalid 'writingSystem' parameter");
2070 switch (writingSystem) {
2078 return u
"Aa\x00C3\x00E1Zz";
2080 return u
"\x0393\x03B1\x03A9\x03C9";
2082 return u
"\x0414\x0434\x0436\x044f";
2084 return u
"\x053f\x054f\x056f\x057f";
2086 return u
"\x05D0\x05D1\x05D2\x05D3";
2088 return u
"\x0623\x0628\x062C\x062F\x064A\x0629\x0020\x0639\x0631\x0628\x064A\x0629";
2090 return u
"\x0715\x0725\x0716\x0726";
2092 return u
"\x0784\x0794\x078c\x078d";
2094 return u
"\x0905\x0915\x0925\x0935";
2096 return u
"\x0986\x0996\x09a6\x09b6";
2098 return u
"\x0a05\x0a15\x0a25\x0a35";
2100 return u
"\x0a85\x0a95\x0aa5\x0ab5";
2102 return u
"\x0b06\x0b16\x0b2b\x0b36";
2104 return u
"\x0b89\x0b99\x0ba9\x0bb9";
2106 return u
"\x0c05\x0c15\x0c25\x0c35";
2108 return u
"\x0c85\x0c95\x0ca5\x0cb5";
2110 return u
"\x0d05\x0d15\x0d25\x0d35";
2112 return u
"\x0d90\x0da0\x0db0\x0dc0";
2114 return u
"\x0e02\x0e12\x0e22\x0e32";
2116 return u
"\x0e8d\x0e9d\x0ead\x0ebd";
2118 return u
"\x0f00\x0f01\x0f02\x0f03";
2120 return u
"\x1000\x1001\x1002\x1003";
2122 return u
"\x10a0\x10b0\x10c0\x10d0";
2124 return u
"\x1780\x1790\x17b0\x17c0";
2126 return u
"\x4e2d\x6587\x8303\x4f8b";
2128 return u
"\x4e2d\x6587\x7bc4\x4f8b";
2130 return u
"\x30b5\x30f3\x30d7\x30eb\x3067\x3059";
2132 return u
"\xac00\xac11\xac1a\xac2f";
2134 return u
"\x1ED7\x1ED9\x1ED1\x1ED3";
2136 return u
"\x1681\x1682\x1683\x1684";
2138 return u
"\x16a0\x16a1\x16a2\x16a3";
2140 return u
"\x7ca\x7cb\x7cc\x7cd";
2168 for (
i = 0;
i < applicationFonts.size(); ++
i)
2169 if (applicationFonts.at(
i).isNull())
2171 if (
i >= applicationFonts.size()) {
2173 i = applicationFonts.size() - 1;
2180 platformFontDatabase->addApplicationFont(
font.data,
font.fileName, &
font);
2181 if (
font.properties.isEmpty())
2184 applicationFonts[
i] =
font;
2197 for (
int i = 0;
i < applicationFonts.size(); ++
i)
2198 if (applicationFonts.at(
i).fileName ==
fileName)
2268 ret.reserve(
d->applicationFonts.value(
id).properties.size());
2270 for (
const auto &
properties :
d->applicationFonts.value(
id).properties)
2299 case SmallestReadableFont:
2308 return integration->fontDatabase()->defaultFont();
2329 if (handle < 0 || handle >=
db->applicationFonts.size())
2355 if (!
db ||
db->applicationFonts.isEmpty())
2358 db->applicationFonts.clear();
2395 if (script < QChar::Script_Latin) {
2396 qCWarning(lcFontDb) <<
"Invalid script passed to addApplicationFallbackFontFamily:" << script;
2401 auto it =
db->applicationFallbackFontFamilies.find(script);
2402 if (
it ==
db->applicationFallbackFontFamilies.end())
2403 it =
db->applicationFallbackFontFamilies.insert(script,
QStringList{});
2405 it->prepend(familyName);
2406 db->fallbacksCache.clear();
2424 auto it =
db->applicationFallbackFontFamilies.find(script);
2425 if (
it !=
db->applicationFallbackFontFamilies.end()) {
2426 if (
it->removeAll(familyName) > 0) {
2428 it =
db->applicationFallbackFontFamilies.erase(
it);
2430 db->fallbacksCache.clear();
2455 if (script < QChar::Script_Latin) {
2456 qCWarning(lcFontDb) <<
"Invalid script passed to setApplicationFallbackFontFamilies:" << script;
2461 db->applicationFallbackFontFamilies[script] = familyNames;
2464 db->fallbacksCache.clear();
2480 return db->applicationFallbackFontFamilies.value(script);
2488 bool preferScriptOverFamily)
2491 ensureFontDatabase();
2498 ->sanitizeRequest(req);
2503#if defined(QT_BUILD_INTERNAL)
2505 if (qt_enable_test_font &&
request.families.first() ==
"__Qt__Box__Engine__"_L1) {
2521 qCDebug(lcFontMatch,
"Cache hit level 1");
2525 if (
request.pixelSize > 0xffff) {
2527 qCDebug(lcFontMatch,
"Rejecting request for pixel size %g2, returning box engine",
double(
request.pixelSize));
2531 QString family_name, foundry_name;
2535 QList<int> blackListed;
2536 unsigned int score = UINT_MAX;
2537 int index =
match(multi ? QChar::Script_Common : script,
request, family_name, foundry_name, &desc, blackListed, &score);
2540 index =
match(multi ? QChar::Script_Common : script,
request, family_name, foundry_name, &desc, blackListed);
2547 if (
index < 0 && !multi && !preferScriptOverFamily)
2548 index =
match(QChar::Script_Common,
request, family_name, foundry_name, &desc, blackListed);
2557 engine = loadEngine(script, fontDef, desc.family, desc.foundry, desc.style, desc.size);
2562 blackListed.append(
index);
2564 qCDebug(lcFontMatch,
" NO MATCH FOUND\n");
2568 if (!requestFamily.isEmpty()) {
2577 QChar::Script(script));
2578 if (script > QChar::Script_Common)
2581 for (
int i = 0; !
engine &&
i < fallbacks.size();
i++) {
2589 index =
match(multi ? QChar::Script_Common : script, def, def.
families.constFirst(),
""_L1, &desc, blackListed);
2592 if (loadDef.families.isEmpty())
2594 engine = loadEngine(script, loadDef, desc.family, desc.foundry, desc.style, desc.size);
2598 blackListed.append(
index);
2608 qCDebug(lcFontMatch,
"returning box engine");
2628 if (!
d->engineData) {
2633 if (!
d->request.families.isEmpty())
2637 if (!
d->engineData) {
2642 d->engineData->ref.ref();
2646 if (
d->engineData->engines[script])
2666 if (!families.isEmpty()) {
2668 if (! family_list.contains(defaultFamily))
2669 family_list << defaultFamily;
2678 for (; !fe &&
it !=
end; ++
it) {
2684 if (fe->ref.loadRelaxed() == 0)
2689 fe->fontDef.pointSize =
qreal(
double((fe->fontDef.pixelSize * 72) /
d->dpi));
2699 for (
int i = 0;
i < QChar::ScriptCount; ++
i) {
2700 if (!
d->engineData->engines[
i]) {
2701 d->engineData->engines[
i] = fe;
2706 d->engineData->engines[script] = fe;
2725 QMultiMap<uint, QString> supported;
2726 for (
int i = 0;
i < families.size(); ++
i) {
2727 const QString &family = families.at(
i);
2730 for (
int x = 0;
x <
db->count; ++
x) {
2732 testFamily =
db->families[
x];
2733 if (testFamily->ensurePopulated())
2739 if (testFamily ==
nullptr
2744 supported.insert(
order, family);
2747 return supported.values();
2752#include "moc_qfontdatabase.cpp"
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
void insertEngineData(const QFontDef &def, QFontEngineData *engineData)
QFontEngine * findEngine(const Key &key)
QFontEngineData * findEngineData(const QFontDef &def) const
static QFontCache * instance()
void insertEngine(const Key &key, QFontEngine *engine, bool insertMulti=false)
bool isApplicationFont(const QString &fileName)
static void parseFontName(const QString &name, QString &foundry, QString &family)
static void load(const QFontPrivate *d, int script)
static QFontDatabasePrivate * ensureFontDatabase()
static QFontDatabasePrivate * instance()
static QFontEngine * findFont(const QFontDef &request, int script, bool preferScriptOverFamily=false)
static QString resolveFontFamilyAlias(const QString &family)
QtFontFamily * family(const QString &f, FamilyRequestFlags flags=EnsurePopulated)
int addAppFont(const QByteArray &fontData, const QString &fileName)
static QList< int > standardSizes()
Returns a list of standard font sizes.
SystemFont
\value GeneralFont The default system font.
static int addApplicationFontFromData(const QByteArray &fontData)
static QString writingSystemName(WritingSystem writingSystem)
Returns the names the writingSystem (e.g.
static bool bold(const QString &family, const QString &style)
Returns true if the font that has family family and style style is bold; otherwise returns false.
WritingSystem
\value Any \value Latin \value Greek \value Cyrillic \value Armenian \value Hebrew \value Arabic \val...
static bool isSmoothlyScalable(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is smoothly scalable; otherwise retur...
static int addApplicationFont(const QString &fileName)
static bool isPrivateFamily(const QString &family)
static QString styleString(const QFont &font)
Returns a string that describes the style of the font.
static bool italic(const QString &family, const QString &style)
Returns true if the font that has family family and style style is italic; otherwise returns false.
static void addApplicationFallbackFontFamily(QChar::Script script, const QString &familyName)
static QFont font(const QString &family, const QString &style, int pointSize)
Returns a QFont object that has family family, style style and point size pointSize.
static QString writingSystemSample(WritingSystem writingSystem)
Returns a string with sample characters from writingSystem.
static bool removeApplicationFont(int id)
static QStringList applicationFallbackFontFamilies(QChar::Script script)
static bool isScalable(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is scalable; otherwise returns false.
static void setApplicationFallbackFontFamilies(QChar::Script, const QStringList &familyNames)
static QStringList families(WritingSystem writingSystem=Any)
Returns a sorted list of the available font families which support the writingSystem.
static bool removeApplicationFallbackFontFamily(QChar::Script script, const QString &familyName)
static bool isBitmapScalable(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is a scalable bitmap font; otherwise ...
static bool hasFamily(const QString &family)
static QList< int > smoothSizes(const QString &family, const QString &style)
Returns the point sizes of a font that has family family and style styleName that will look attractiv...
static QList< WritingSystem > writingSystems()
Returns a sorted list of the available writing systems.
static QList< int > pointSizes(const QString &family, const QString &style=QString())
Returns a list of the point sizes available for the font that has family family and style styleName.
static QFont systemFont(SystemFont type)
static QStringList applicationFontFamilies(int id)
static QStringList styles(const QString &family)
Returns a list of the styles available for the font family family.
static bool removeAllApplicationFonts()
static bool isFixedPitch(const QString &family, const QString &style=QString())
Returns true if the font that has family family and style style is fixed pitch; otherwise returns fal...
static int weight(const QString &family, const QString &style)
Returns the weight of the font that has family family and style style.
QString styleName() const
QFont::Style style() const
Returns the style value of the matched window system font.
int weight() const
Returns the weight of the matched window system font.
static QStringList substitutes(const QString &)
Returns a list of family names to be used whenever familyName is specified.
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
void setStyle(Style style)
Sets the style of the font to style.
QString styleName() const
Weight weight() const
Returns the weight of the font, using the same scale as the \l{QFont::Weight} enumeration.
Style style() const
Returns the style of the font.
Style
This enum describes the different styles of glyphs that are used to display text.
static QPlatformIntegration * platformIntegration()
static QPlatformTheme * platformTheme()
static QFont font()
Returns the default application font.
void push_back(parameter_type t)
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator ConstIterator
void unlock() noexcept
Unlocks this mutex locker.
const_iterator constBegin() const noexcept
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString left(qsizetype n) const &
QByteArray toLatin1() const &
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const noexcept
Returns the number of characters in this string.
QString first(qsizetype n) const &
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString toLower() const &
QChar * data()
Returns a pointer to the data stored in the QString.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.
bool supported(QFontDatabase::WritingSystem) const
Returns true if the writing system specified by writingSystem is supported; otherwise returns false.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR uint qPopulationCount(quint32 v) noexcept
QList< QString > QStringList
Constructs a string list that contains the given string, str.
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
int qRound(qfloat16 d) noexcept
QRecursiveMutex * qt_fontdatabase_mutex()
QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
Q_GUI_EXPORT int qt_defaultDpiY()
static bool familySupportsWritingSystem(QtFontFamily *family, size_t writingSystem)
static bool equalsCaseInsensitive(const QString &a, const QString &b)
static void parseFontName(const QString &name, QString &foundry, QString &family)
bool qt_isFontFamilyPopulated(const QString &familyName)
void qt_registerFont(const QString &familyName, const QString &stylename, const QString &foundryname, int weight, QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle)
static QString styleStringHelper(int weight, QFont::Style style)
static const int scriptForWritingSystem[]
Q_GUI_EXPORT QStringList qt_sort_families_by_writing_system(QChar::Script script, const QStringList &families)
static int getFontWeight(const QString &weightString)
static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
Q_GUI_EXPORT QFontDatabase::WritingSystem qt_writing_system_for_script(int script)
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
Q_GUI_EXPORT int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
void qt_registerFontFamily(const QString &familyName)
void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias)
QString qt_resolveFontFamilyAlias(const QString &alias)
static QStringList familyList(const QFontDef &req)
static QtFontStyle * bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey, const QString &styleName=QString())
QByteArray qt_fontdata_from_index(int)
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
void qt_cleanupFontDatabase()
static QByteArray cacheKey(Args &&...args)
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr T qAbs(const T &t)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLboolean GLboolean GLboolean b
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint GLfloat weight
GLsizei GLsizei GLfloat distance
GLenum const void GLbitfield fontStyle
GLenum GLsizeiptr const void * fontData
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLfixed GLfixed GLint GLint order
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
static QStringList aliases(const QQmlJSScope::ConstPtr &scope)
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
#define Q_AUTOTEST_EXPORT
#define Q_TRACE_POINT(provider, tracepoint,...)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
#define QT_TRANSLATE_NOOP(scope, x)
unsigned long long quint64
Q_CHECK_PTR(a=new int[80])
std::uniform_real_distribution dist(1, 2.5)
[2]
QNetworkRequest request(url)
char * toString(const MyType &t)
[31]
QStringList fallBackFamilies
\inmodule QtCore \reentrant
QtFontFoundry ** foundries
unsigned char writingSystems[QFontDatabase::WritingSystemsCount]
bool matchesFamilyName(const QString &familyName) const
QtFontFoundry * foundry(const QString &f, bool=false)
QtFontStyle * style(const QtFontStyle::Key &, const QString &=QString(), bool=false)
QtFontStyle(const Key &k)
QtFontSize * pixelSize(unsigned short size, bool=false)