Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | __attribute__((visibility("default"))) void qt_registerFont(const QString &familyName, const QString &stylename, | - |
8 | const QString &foundryname, int weight, | - |
9 | QFont::Style style, int stretch, bool antialiased, | - |
10 | bool scalable, int pixelSize, bool fixedPitch, | - |
11 | const QSupportedWritingSystems &writingSystems, void *handle) | - |
12 | { | - |
13 | QFontDatabasePrivate *d = privateDb(); | - |
14 | | - |
15 | QtFontStyle::Key styleKey; | - |
16 | styleKey.style = style; | - |
17 | styleKey.weight = weight; | - |
18 | styleKey.stretch = stretch; | - |
19 | QtFontFamily *f = d->family(familyName, true); | - |
20 | f->fixedPitch = fixedPitch; | - |
21 | | - |
22 | for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) { evaluated: i < QFontDatabase::WritingSystemsCount yes Evaluation Count:1752156 | yes Evaluation Count:51534 |
| 51534-1752156 |
23 | if (writingSystems.supported(QFontDatabase::WritingSystem(i))) { evaluated: writingSystems.supported(QFontDatabase::WritingSystem(i)) yes Evaluation Count:89758 | yes Evaluation Count:1662398 |
| 89758-1662398 |
24 | f->writingSystems[i] = QtFontFamily::Supported; | - |
25 | } else { executed: } Execution Count:89758 | 89758 |
26 | f->writingSystems[i] = QtFontFamily::Unsupported; | - |
27 | } executed: } Execution Count:1662398 | 1662398 |
28 | } | - |
29 | | - |
30 | QtFontFoundry *foundry = f->foundry(foundryname, true); | - |
31 | QtFontStyle *fontStyle = foundry->style(styleKey, stylename, true); | - |
32 | fontStyle->smoothScalable = scalable; | - |
33 | fontStyle->antialiased = antialiased; | - |
34 | QtFontSize *size = fontStyle->pixelSize(pixelSize ? pixelSize : 0xffff, true); | - |
35 | if (size->handle) { evaluated: size->handle yes Evaluation Count:16163 | yes Evaluation Count:35371 |
| 16163-35371 |
36 | QPlatformIntegration *integration = QGuiApplicationPrivate::platformIntegration(); | - |
37 | if (integration) partially evaluated: integration yes Evaluation Count:16163 | no Evaluation Count:0 |
| 0-16163 |
38 | integration->fontDatabase()->releaseHandle(size->handle); executed: integration->fontDatabase()->releaseHandle(size->handle); Execution Count:16163 | 16163 |
39 | } executed: } Execution Count:16163 | 16163 |
40 | size->handle = handle; | - |
41 | } executed: } Execution Count:51534 | 51534 |
42 | | - |
43 | __attribute__((visibility("default"))) void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias) | - |
44 | { | - |
45 | if (alias.isEmpty()) never evaluated: alias.isEmpty() | 0 |
46 | return; | 0 |
47 | | - |
48 | QFontDatabasePrivate *d = privateDb(); | - |
49 | QtFontFamily *f = d->family(familyName, false); | - |
50 | if (!f) | 0 |
51 | return; | 0 |
52 | | - |
53 | if (f->aliases.contains(alias, Qt::CaseInsensitive)) never evaluated: f->aliases.contains(alias, Qt::CaseInsensitive) | 0 |
54 | return; | 0 |
55 | | - |
56 | f->aliases.push_back(alias); | - |
57 | } | 0 |
58 | | - |
59 | static QStringList fallbackFamilies(const QString &family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) | - |
60 | { | - |
61 | QStringList retList = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script); | - |
62 | QFontDatabasePrivate *db = privateDb(); | - |
63 | | - |
64 | QStringList::iterator i; | - |
65 | for (i = retList.begin(); i != retList.end(); ++i) { evaluated: i != retList.end() yes Evaluation Count:51836 | yes Evaluation Count:593 |
| 593-51836 |
66 | bool contains = false; | - |
67 | for (int j = 0; j < db->count; j++) { partially evaluated: j < db->count yes Evaluation Count:2338652 | no Evaluation Count:0 |
| 0-2338652 |
68 | QtFontFamily *qtFamily = db->families[j]; | - |
69 | if (!(i->compare(qtFamily->name,Qt::CaseInsensitive))) { evaluated: !(i->compare(qtFamily->name,Qt::CaseInsensitive)) yes Evaluation Count:51836 | yes Evaluation Count:2286816 |
| 51836-2286816 |
70 | contains = true; | - |
71 | break; executed: break; Execution Count:51836 | 51836 |
72 | } | - |
73 | } executed: } Execution Count:2286816 | 2286816 |
74 | if (!contains) { partially evaluated: !contains no Evaluation Count:0 | yes Evaluation Count:51836 |
| 0-51836 |
75 | i = retList.erase(i); | - |
76 | i--; | - |
77 | } | 0 |
78 | } executed: } Execution Count:51836 | 51836 |
79 | return retList; executed: return retList; Execution Count:593 | 593 |
80 | } | - |
81 | | - |
82 | static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt); | - |
83 | | - |
84 | static void initializeDb() | - |
85 | { | - |
86 | QFontDatabasePrivate *db = privateDb(); | - |
87 | | - |
88 | | - |
89 | if (!db->count) evaluated: !db->count yes Evaluation Count:151 | yes Evaluation Count:352 |
| 151-352 |
90 | QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase(); executed: QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase(); Execution Count:151 | 151 |
91 | | - |
92 | if (db->reregisterAppFonts) { evaluated: db->reregisterAppFonts yes Evaluation Count:41 | yes Evaluation Count:462 |
| 41-462 |
93 | for (int i = 0; i < db->applicationFonts.count(); i++) { evaluated: i < db->applicationFonts.count() yes Evaluation Count:41 | yes Evaluation Count:41 |
| 41 |
94 | if (!db->applicationFonts.at(i).families.isEmpty()) evaluated: !db->applicationFonts.at(i).families.isEmpty() yes Evaluation Count:21 | yes Evaluation Count:20 |
| 20-21 |
95 | registerFont(&db->applicationFonts[i]); executed: registerFont(&db->applicationFonts[i]); Execution Count:21 | 21 |
96 | } executed: } Execution Count:41 | 41 |
97 | db->reregisterAppFonts = false; | - |
98 | } executed: } Execution Count:41 | 41 |
99 | } executed: } Execution Count:503 | 503 |
100 | | - |
101 | static inline void load(const QString & = QString(), int = -1) | - |
102 | { | - |
103 | | - |
104 | if (!privateDb()->count) evaluated: !privateDb()->count yes Evaluation Count:4 | yes Evaluation Count:4309 |
| 4-4309 |
105 | initializeDb(); executed: initializeDb(); Execution Count:4 | 4 |
106 | } executed: } Execution Count:4313 | 4313 |
107 | | - |
108 | static | - |
109 | QFontEngine *loadSingleEngine(int script, | - |
110 | const QFontDef &request, | - |
111 | QtFontFoundry *foundry, | - |
112 | QtFontStyle *style, QtFontSize *size) | - |
113 | { | - |
114 | (void)foundry;; | - |
115 | | - |
116 | qt_noop(); | - |
117 | QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); | - |
118 | int pixelSize = size->pixelSize; | - |
119 | if (!pixelSize || (style->smoothScalable && pixelSize == 0xffff) partially evaluated: !pixelSize no Evaluation Count:0 | yes Evaluation Count:891 |
partially evaluated: style->smoothScalable yes Evaluation Count:891 | no Evaluation Count:0 |
partially evaluated: pixelSize == 0xffff yes Evaluation Count:891 | no Evaluation Count:0 |
| 0-891 |
120 | || pfdb->fontsAlwaysScalable()) { never evaluated: pfdb->fontsAlwaysScalable() | 0 |
121 | pixelSize = request.pixelSize; | - |
122 | } executed: } Execution Count:891 | 891 |
123 | | - |
124 | QFontDef def = request; | - |
125 | def.pixelSize = pixelSize; | - |
126 | | - |
127 | QFontCache::Key key(def,script); | - |
128 | QFontEngine *engine = QFontCache::instance()->findEngine(key); | - |
129 | if (!engine) { partially evaluated: !engine yes Evaluation Count:891 | no Evaluation Count:0 |
| 0-891 |
130 | engine = pfdb->fontEngine(def,QUnicodeTables::Script(script),size->handle); | - |
131 | if (engine) { evaluated: engine yes Evaluation Count:626 | yes Evaluation Count:265 |
| 265-626 |
132 | QFontCache::Key key(def,script); | - |
133 | QFontCache::instance()->instance()->insertEngine(key,engine); | - |
134 | } executed: } Execution Count:626 | 626 |
135 | } executed: } Execution Count:891 | 891 |
136 | return engine; executed: return engine; Execution Count:891 | 891 |
137 | } | - |
138 | | - |
139 | static | - |
140 | QFontEngine *loadEngine(int script, const QFontDef &request, | - |
141 | QtFontFamily *family, QtFontFoundry *foundry, | - |
142 | QtFontStyle *style, QtFontSize *size) | - |
143 | { | - |
144 | | - |
145 | QFontEngine *engine = loadSingleEngine(script, request, foundry, style, size); | - |
146 | | - |
147 | if (engine && engine->type() != QFontEngine::Multi evaluated: engine yes Evaluation Count:626 | yes Evaluation Count:265 |
partially evaluated: engine->type() != QFontEngine::Multi yes Evaluation Count:626 | no Evaluation Count:0 |
| 0-626 |
148 | && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol ) { evaluated: !(request.styleStrategy & QFont::NoFontMerging) yes Evaluation Count:624 | yes Evaluation Count:2 |
evaluated: !engine->symbol yes Evaluation Count:600 | yes Evaluation Count:24 |
| 2-624 |
149 | | - |
150 | if (family && !family->askedForFallback) { partially evaluated: family yes Evaluation Count:600 | no Evaluation Count:0 |
evaluated: !family->askedForFallback yes Evaluation Count:386 | yes Evaluation Count:214 |
| 0-600 |
151 | QFont::Style fontStyle = QFont::Style(style->key.style); | - |
152 | QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint); | - |
153 | if (styleHint == QFont::AnyStyle && request.fixedPitch) partially evaluated: styleHint == QFont::AnyStyle yes Evaluation Count:386 | no Evaluation Count:0 |
partially evaluated: request.fixedPitch no Evaluation Count:0 | yes Evaluation Count:386 |
| 0-386 |
154 | styleHint = QFont::TypeWriter; never executed: styleHint = QFont::TypeWriter; | 0 |
155 | family->fallbackFamilies = fallbackFamilies(family->name,fontStyle,styleHint,QUnicodeTables::Script(script)); | - |
156 | | - |
157 | family->askedForFallback = true; | - |
158 | } executed: } Execution Count:386 | 386 |
159 | | - |
160 | QStringList fallbacks = privateDb()->fallbackFamilies; | - |
161 | if (family && !family->fallbackFamilies.isEmpty()) partially evaluated: family yes Evaluation Count:600 | no Evaluation Count:0 |
partially evaluated: !family->fallbackFamilies.isEmpty() yes Evaluation Count:600 | no Evaluation Count:0 |
| 0-600 |
162 | fallbacks = family->fallbackFamilies; executed: fallbacks = family->fallbackFamilies; Execution Count:600 | 600 |
163 | | - |
164 | QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); | - |
165 | QFontEngineMulti *pfMultiEngine = pfdb->fontEngineMulti(engine, QUnicodeTables::Script(script)); | - |
166 | pfMultiEngine->setFallbackFamiliesList(fallbacks); | - |
167 | engine = pfMultiEngine; | - |
168 | | - |
169 | | - |
170 | | - |
171 | QFontCache::Key key(request, script, 1); | - |
172 | QFontCache::instance()->instance()->insertEngine(key, engine); | - |
173 | } executed: } Execution Count:600 | 600 |
174 | | - |
175 | return engine; executed: return engine; Execution Count:891 | 891 |
176 | } | - |
177 | | - |
178 | static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) | - |
179 | { | - |
180 | QFontDatabasePrivate *db = privateDb(); | - |
181 | | - |
182 | fnt->families = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName); | - |
183 | | - |
184 | db->reregisterAppFonts = true; | - |
185 | } executed: } Execution Count:42 | 42 |
186 | | - |
187 | bool QFontDatabase::removeApplicationFont(int handle) | - |
188 | { | - |
189 | QMutexLocker locker(fontDatabaseMutex()); | - |
190 | | - |
191 | QFontDatabasePrivate *db = privateDb(); | - |
192 | if (handle < 0 || handle >= db->applicationFonts.count()) partially evaluated: handle < 0 no Evaluation Count:0 | yes Evaluation Count:21 |
partially evaluated: handle >= db->applicationFonts.count() no Evaluation Count:0 | yes Evaluation Count:21 |
| 0-21 |
193 | return false; never executed: return false; | 0 |
194 | | - |
195 | db->applicationFonts[handle] = QFontDatabasePrivate::ApplicationFont(); | - |
196 | | - |
197 | db->reregisterAppFonts = true; | - |
198 | db->invalidate(); | - |
199 | return true; executed: return true; Execution Count:21 | 21 |
200 | } | - |
201 | | - |
202 | bool QFontDatabase::removeAllApplicationFonts() | - |
203 | { | - |
204 | QMutexLocker locker(fontDatabaseMutex()); | - |
205 | | - |
206 | QFontDatabasePrivate *db = privateDb(); | - |
207 | if (db->applicationFonts.isEmpty()) never evaluated: db->applicationFonts.isEmpty() | 0 |
208 | return false; never executed: return false; | 0 |
209 | | - |
210 | db->applicationFonts.clear(); | - |
211 | db->invalidate(); | - |
212 | return true; never executed: return true; | 0 |
213 | } | - |
214 | | - |
215 | bool QFontDatabase::supportsThreadedFontRendering() | - |
216 | { | - |
217 | return true; executed: return true; Execution Count:1 | 1 |
218 | } | - |
219 | | - |
220 | | - |
221 | | - |
222 | | - |
223 | QFontEngine * | - |
224 | QFontDatabase::findFont(int script, const QFontPrivate *fp, | - |
225 | const QFontDef &request, bool multi) | - |
226 | { | - |
227 | QMutexLocker locker(fontDatabaseMutex()); | - |
228 | | - |
229 | const int force_encoding_id = -1; | - |
230 | | - |
231 | if (!privateDb()->count) evaluated: !privateDb()->count yes Evaluation Count:125 | yes Evaluation Count:521 |
| 125-521 |
232 | initializeDb(); executed: initializeDb(); Execution Count:125 | 125 |
233 | | - |
234 | QFontEngine *engine; | - |
235 | QFontCache::Key key(request, script, multi ? 1 : 0); | - |
236 | engine = QFontCache::instance()->findEngine(key); | - |
237 | if (engine) { evaluated: engine yes Evaluation Count:7 | yes Evaluation Count:639 |
| 7-639 |
238 | if (false) QMessageLogger("text/qfontdatabase_qpa.cpp", 286, __PRETTY_FUNCTION__).debug("Cache hit level 1"); never executed: QMessageLogger("text/qfontdatabase_qpa.cpp", 286, __PRETTY_FUNCTION__).debug("Cache hit level 1"); partially evaluated: false no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
239 | return engine; executed: return engine; Execution Count:7 | 7 |
240 | } | - |
241 | | - |
242 | QString family_name, foundry_name; | - |
243 | | - |
244 | parseFontName(request.family, foundry_name, family_name); | - |
245 | | - |
246 | if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) { partially evaluated: qt_enable_test_font no Evaluation Count:0 | yes Evaluation Count:639 |
never evaluated: request.family == QLatin1String("__Qt__Box__Engine__") | 0-639 |
247 | engine =new QTestFontEngine(request.pixelSize); | - |
248 | engine->fontDef = request; | - |
249 | } | 0 |
250 | | - |
251 | QtFontDesc desc; | - |
252 | match(script, request, family_name, foundry_name, force_encoding_id, &desc); | - |
253 | if (desc.family != 0 && desc.foundry != 0 && desc.style != 0) { evaluated: desc.family != 0 yes Evaluation Count:607 | yes Evaluation Count:32 |
partially evaluated: desc.foundry != 0 yes Evaluation Count:607 | no Evaluation Count:0 |
partially evaluated: desc.style != 0 yes Evaluation Count:607 | no Evaluation Count:0 |
| 0-607 |
254 | engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size); | - |
255 | } else { executed: } Execution Count:607 | 607 |
256 | if (false) QMessageLogger("text/qfontdatabase_qpa.cpp", 304, __PRETTY_FUNCTION__).debug(" NO MATCH FOUND\n"); never executed: QMessageLogger("text/qfontdatabase_qpa.cpp", 304, __PRETTY_FUNCTION__).debug(" NO MATCH FOUND\n"); partially evaluated: false no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
257 | } executed: } Execution Count:32 | 32 |
258 | | - |
259 | if (engine && engine->type() != QFontEngine::TestFontEngine) { evaluated: engine yes Evaluation Count:430 | yes Evaluation Count:209 |
partially evaluated: engine->type() != QFontEngine::TestFontEngine yes Evaluation Count:430 | no Evaluation Count:0 |
| 0-430 |
260 | initFontDef(desc, request, &engine->fontDef, engine->type() == QFontEngine::Multi); | - |
261 | | - |
262 | if (fp) { evaluated: fp yes Evaluation Count:428 | yes Evaluation Count:2 |
| 2-428 |
263 | QFontDef def = request; | - |
264 | if (def.family.isEmpty()) { partially evaluated: def.family.isEmpty() no Evaluation Count:0 | yes Evaluation Count:428 |
| 0-428 |
265 | def.family = fp->request.family; | - |
266 | def.family = def.family.left(def.family.indexOf(QLatin1Char(','))); | - |
267 | } | 0 |
268 | } executed: } Execution Count:428 | 428 |
269 | } executed: } Execution Count:430 | 430 |
270 | | - |
271 | if (!engine) { evaluated: !engine yes Evaluation Count:209 | yes Evaluation Count:430 |
| 209-430 |
272 | if (!request.family.isEmpty()) { evaluated: !request.family.isEmpty() yes Evaluation Count:207 | yes Evaluation Count:2 |
| 2-207 |
273 | QStringList fallbacks = request.fallBackFamilies | - |
274 | + fallbackFamilies(request.family, | - |
275 | QFont::Style(request.style), | - |
276 | QFont::StyleHint(request.styleHint), | - |
277 | QUnicodeTables::Script(script)); | - |
278 | | - |
279 | for (int i = 0; !engine && i < fallbacks.size(); i++) { evaluated: !engine yes Evaluation Count:418 | yes Evaluation Count:205 |
evaluated: i < fallbacks.size() yes Evaluation Count:416 | yes Evaluation Count:2 |
| 2-418 |
280 | QFontDef def = request; | - |
281 | def.family = fallbacks.at(i); | - |
282 | QFontCache::Key key(def, script, multi ? 1 : 0); | - |
283 | engine = QFontCache::instance()->findEngine(key); | - |
284 | if (!engine) { evaluated: !engine yes Evaluation Count:407 | yes Evaluation Count:9 |
| 9-407 |
285 | QtFontDesc desc; | - |
286 | match(script, def, def.family, QLatin1String(""), 0, &desc); | - |
287 | if (desc.family == 0 && desc.foundry == 0 && desc.style == 0) { evaluated: desc.family == 0 yes Evaluation Count:123 | yes Evaluation Count:284 |
partially evaluated: desc.foundry == 0 yes Evaluation Count:123 | no Evaluation Count:0 |
partially evaluated: desc.style == 0 yes Evaluation Count:123 | no Evaluation Count:0 |
| 0-284 |
288 | continue; executed: continue; Execution Count:123 | 123 |
289 | } | - |
290 | engine = loadEngine(script, def, desc.family, desc.foundry, desc.style, desc.size); | - |
291 | if (engine) { evaluated: engine yes Evaluation Count:196 | yes Evaluation Count:88 |
| 88-196 |
292 | initFontDef(desc, def, &engine->fontDef, engine->type() == QFontEngine::Multi); | - |
293 | } executed: } Execution Count:196 | 196 |
294 | } executed: } Execution Count:284 | 284 |
295 | } executed: } Execution Count:293 | 293 |
296 | } executed: } Execution Count:207 | 207 |
297 | | - |
298 | if (!engine) evaluated: !engine yes Evaluation Count:4 | yes Evaluation Count:205 |
| 4-205 |
299 | engine = new QFontEngineBox(request.pixelSize); executed: engine = new QFontEngineBox(request.pixelSize); Execution Count:4 | 4 |
300 | | - |
301 | if (false) QMessageLogger("text/qfontdatabase_qpa.cpp", 349, __PRETTY_FUNCTION__).debug("returning box engine"); never executed: QMessageLogger("text/qfontdatabase_qpa.cpp", 349, __PRETTY_FUNCTION__).debug("returning box engine"); partially evaluated: false no Evaluation Count:0 | yes Evaluation Count:209 |
| 0-209 |
302 | } executed: } Execution Count:209 | 209 |
303 | | - |
304 | if (fp && fp->dpi > 0) { evaluated: fp yes Evaluation Count:637 | yes Evaluation Count:2 |
evaluated: fp->dpi > 0 yes Evaluation Count:635 | yes Evaluation Count:2 |
| 2-637 |
305 | engine->fontDef.pointSize = qreal(double((engine->fontDef.pixelSize * 72) / fp->dpi)); | - |
306 | } else { executed: } Execution Count:635 | 635 |
307 | engine->fontDef.pointSize = request.pointSize; | - |
308 | } executed: } Execution Count:4 | 4 |
309 | | - |
310 | return engine; executed: return engine; Execution Count:639 | 639 |
311 | } | - |
312 | | - |
313 | void QFontDatabase::load(const QFontPrivate *d, int script) | - |
314 | { | - |
315 | QFontDef req = d->request; | - |
316 | | - |
317 | if (req.pixelSize == -1) { evaluated: req.pixelSize == -1 yes Evaluation Count:29815 | yes Evaluation Count:114 |
| 114-29815 |
318 | req.pixelSize = floor(((req.pointSize * d->dpi) / 72) * 100 + 0.5) / 100; | - |
319 | req.pixelSize = qRound(req.pixelSize); | - |
320 | } executed: } Execution Count:29815 | 29815 |
321 | if (req.pointSize < 0) evaluated: req.pointSize < 0 yes Evaluation Count:114 | yes Evaluation Count:29815 |
| 114-29815 |
322 | req.pointSize = req.pixelSize*72.0/d->dpi; executed: req.pointSize = req.pixelSize*72.0/d->dpi; Execution Count:114 | 114 |
323 | if (req.weight == 0) partially evaluated: req.weight == 0 no Evaluation Count:0 | yes Evaluation Count:29929 |
| 0-29929 |
324 | req.weight = QFont::Normal; never executed: req.weight = QFont::Normal; | 0 |
325 | if (req.stretch == 0) partially evaluated: req.stretch == 0 no Evaluation Count:0 | yes Evaluation Count:29929 |
| 0-29929 |
326 | req.stretch = 100; never executed: req.stretch = 100; | 0 |
327 | | - |
328 | | - |
329 | | - |
330 | | - |
331 | bool multi = !(req.styleStrategy & QFont::NoFontMerging); | - |
332 | QFontCache::Key key(req, script, multi ? 1 : 0); | - |
333 | | - |
334 | if (!d->engineData) evaluated: !d->engineData yes Evaluation Count:29910 | yes Evaluation Count:19 |
| 19-29910 |
335 | getEngineData(d, req); executed: getEngineData(d, req); Execution Count:29910 | 29910 |
336 | | - |
337 | | - |
338 | if (d->engineData->engines[script]) evaluated: d->engineData->engines[script] yes Evaluation Count:29292 | yes Evaluation Count:637 |
| 637-29292 |
339 | return; executed: return; Execution Count:29292 | 29292 |
340 | | - |
341 | QFontEngine *fe = QFontCache::instance()->findEngine(key); | - |
342 | | - |
343 | | - |
344 | QStringList family_list; | - |
345 | | - |
346 | if (!req.family.isEmpty()) { partially evaluated: !req.family.isEmpty() yes Evaluation Count:637 | no Evaluation Count:0 |
| 0-637 |
347 | QStringList familiesForRequest = familyList(req); | - |
348 | | - |
349 | | - |
350 | family_list << familiesForRequest.takeFirst(); | - |
351 | | - |
352 | | - |
353 | req.fallBackFamilies = familiesForRequest; | - |
354 | | - |
355 | | - |
356 | QString defaultFamily = QGuiApplication::font().family(); | - |
357 | if (! family_list.contains(defaultFamily)) evaluated: ! family_list.contains(defaultFamily) yes Evaluation Count:460 | yes Evaluation Count:177 |
| 177-460 |
358 | family_list << defaultFamily; executed: family_list << defaultFamily; Execution Count:460 | 460 |
359 | | - |
360 | } executed: } Execution Count:637 | 637 |
361 | | - |
362 | | - |
363 | family_list << QString(); | - |
364 | | - |
365 | QStringList::ConstIterator it = family_list.constBegin(), end = family_list.constEnd(); | - |
366 | for (; !fe && it != end; ++it) { evaluated: !fe yes Evaluation Count:637 | yes Evaluation Count:637 |
partially evaluated: it != end yes Evaluation Count:637 | no Evaluation Count:0 |
| 0-637 |
367 | req.family = *it; | - |
368 | | - |
369 | fe = QFontDatabase::findFont(script, d, req, multi); | - |
370 | if (fe && (fe->type()==QFontEngine::Box) && !req.family.isEmpty()) { partially evaluated: fe yes Evaluation Count:637 | no Evaluation Count:0 |
evaluated: (fe->type()==QFontEngine::Box) yes Evaluation Count:4 | yes Evaluation Count:633 |
evaluated: !req.family.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:2 |
| 0-637 |
371 | if (fe->ref.load() == 0) partially evaluated: fe->ref.load() == 0 yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
372 | delete fe; executed: delete fe; Execution Count:2 | 2 |
373 | | - |
374 | fe = 0; | - |
375 | } executed: } Execution Count:2 | 2 |
376 | | - |
377 | | - |
378 | req.fallBackFamilies.clear(); | - |
379 | } executed: } Execution Count:637 | 637 |
380 | | - |
381 | if (fe->symbol || (d->request.styleStrategy & QFont::NoFontMerging)) { evaluated: fe->symbol yes Evaluation Count:24 | yes Evaluation Count:613 |
partially evaluated: (d->request.styleStrategy & QFont::NoFontMerging) no Evaluation Count:0 | yes Evaluation Count:613 |
| 0-613 |
382 | for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) { evaluated: i < QUnicodeTables::ScriptCount yes Evaluation Count:672 | yes Evaluation Count:24 |
| 24-672 |
383 | if (!d->engineData->engines[i]) { partially evaluated: !d->engineData->engines[i] yes Evaluation Count:672 | no Evaluation Count:0 |
| 0-672 |
384 | d->engineData->engines[i] = fe; | - |
385 | fe->ref.ref(); | - |
386 | } executed: } Execution Count:672 | 672 |
387 | } executed: } Execution Count:672 | 672 |
388 | } else { executed: } Execution Count:24 | 24 |
389 | d->engineData->engines[script] = fe; | - |
390 | fe->ref.ref(); | - |
391 | } executed: } Execution Count:613 | 613 |
392 | } | - |
393 | | - |
394 | QString QFontDatabase::resolveFontFamilyAlias(const QString &family) | - |
395 | { | - |
396 | return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(family); executed: return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(family); Execution Count:9 | 9 |
397 | } | - |
398 | | - |
399 | | - |
400 | | - |
| | |