Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/text/qfont.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | bool QFontDef::exactMatch(const QFontDef &other) const | - | ||||||||||||||||||||||||
12 | { | - | ||||||||||||||||||||||||
13 | if (pixelSize != -1
| 0 | ||||||||||||||||||||||||
14 | if (pixelSize != other.pixelSize
| 0 | ||||||||||||||||||||||||
15 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
16 | } never executed: else if (pointSize != -1end of block
| 0 | ||||||||||||||||||||||||
17 | if (pointSize != other.pointSize
| 0 | ||||||||||||||||||||||||
18 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
19 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
20 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
21 | } | - | ||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||
23 | if (!ignorePitch
| 0 | ||||||||||||||||||||||||
24 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||
26 | if (stretch != 0
| 0 | ||||||||||||||||||||||||
27 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | QString this_family, this_foundry, other_family, other_foundry; | - | ||||||||||||||||||||||||
30 | QFontDatabase::parseFontName(family, this_foundry, this_family); | - | ||||||||||||||||||||||||
31 | QFontDatabase::parseFontName(other.family, other_foundry, other_family); | - | ||||||||||||||||||||||||
32 | - | |||||||||||||||||||||||||
33 | this_family = QFontDatabase::resolveFontFamilyAlias(this_family); | - | ||||||||||||||||||||||||
34 | other_family = QFontDatabase::resolveFontFamilyAlias(other_family); | - | ||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||
36 | return never executed: (styleHint == other.styleHintreturn (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) );
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
37 | && styleStrategy == other.styleStrategy
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
38 | && weight == other.weight
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
39 | && style == other.style
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
40 | && this_family == other_family
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
41 | && (styleName.isEmpty()
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
42 | && (this_foundry.isEmpty()
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
43 | || other_foundry.isEmpty()
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
44 | || this_foundry == other_foundry
never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
45 | ); never executed: return (styleHint == other.styleHint && styleStrategy == other.styleStrategy && weight == other.weight && style == other.style && this_family == other_family && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName) && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) ); | 0 | ||||||||||||||||||||||||
46 | } | - | ||||||||||||||||||||||||
47 | - | |||||||||||||||||||||||||
48 | extern bool qt_is_gui_used; | - | ||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||
50 | __attribute__((visibility("default"))) int qt_defaultDpiX() | - | ||||||||||||||||||||||||
51 | { | - | ||||||||||||||||||||||||
52 | if (QCoreApplication::instance()->testAttribute(Qt::AA_Use96Dpi)
| 0 | ||||||||||||||||||||||||
53 | return never executed: 96;return 96; never executed: return 96; | 0 | ||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||
55 | if (!qt_is_gui_used
| 0 | ||||||||||||||||||||||||
56 | return never executed: 75;return 75; never executed: return 75; | 0 | ||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||
58 | if (const
| 0 | ||||||||||||||||||||||||
59 | return never executed: qRound(screen->logicalDotsPerInchX());return qRound(screen->logicalDotsPerInchX()); never executed: return qRound(screen->logicalDotsPerInchX()); | 0 | ||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||
61 | - | |||||||||||||||||||||||||
62 | return never executed: 100;return 100; never executed: return 100; | 0 | ||||||||||||||||||||||||
63 | } | - | ||||||||||||||||||||||||
64 | - | |||||||||||||||||||||||||
65 | __attribute__((visibility("default"))) int qt_defaultDpiY() | - | ||||||||||||||||||||||||
66 | { | - | ||||||||||||||||||||||||
67 | if (QCoreApplication::instance()->testAttribute(Qt::AA_Use96Dpi)
| 0 | ||||||||||||||||||||||||
68 | return never executed: 96;return 96; never executed: return 96; | 0 | ||||||||||||||||||||||||
69 | - | |||||||||||||||||||||||||
70 | if (!qt_is_gui_used
| 0 | ||||||||||||||||||||||||
71 | return never executed: 75;return 75; never executed: return 75; | 0 | ||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||
73 | if (const
| 0 | ||||||||||||||||||||||||
74 | return never executed: qRound(screen->logicalDotsPerInchY());return qRound(screen->logicalDotsPerInchY()); never executed: return qRound(screen->logicalDotsPerInchY()); | 0 | ||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||
77 | return never executed: 100;return 100; never executed: return 100; | 0 | ||||||||||||||||||||||||
78 | } | - | ||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||
80 | __attribute__((visibility("default"))) int qt_defaultDpi() | - | ||||||||||||||||||||||||
81 | { | - | ||||||||||||||||||||||||
82 | return never executed: qt_defaultDpiY();return qt_defaultDpiY(); never executed: return qt_defaultDpiY(); | 0 | ||||||||||||||||||||||||
83 | } | - | ||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||
85 | QFontPrivate::QFontPrivate() | - | ||||||||||||||||||||||||
86 | : engineData(0), dpi(qt_defaultDpi()), screen(0), | - | ||||||||||||||||||||||||
87 | underline(false), overline(false), strikeOut(false), kerning(true), | - | ||||||||||||||||||||||||
88 | capital(0), letterSpacingIsAbsolute(false), scFont(0) | - | ||||||||||||||||||||||||
89 | { | - | ||||||||||||||||||||||||
90 | } never executed: end of block | 0 | ||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||
92 | QFontPrivate::QFontPrivate(const QFontPrivate &other) | - | ||||||||||||||||||||||||
93 | : request(other.request), engineData(0), dpi(other.dpi), screen(other.screen), | - | ||||||||||||||||||||||||
94 | underline(other.underline), overline(other.overline), | - | ||||||||||||||||||||||||
95 | strikeOut(other.strikeOut), kerning(other.kerning), | - | ||||||||||||||||||||||||
96 | capital(other.capital), letterSpacingIsAbsolute(other.letterSpacingIsAbsolute), | - | ||||||||||||||||||||||||
97 | letterSpacing(other.letterSpacing), wordSpacing(other.wordSpacing), | - | ||||||||||||||||||||||||
98 | scFont(other.scFont) | - | ||||||||||||||||||||||||
99 | { | - | ||||||||||||||||||||||||
100 | if (scFont
| 0 | ||||||||||||||||||||||||
101 | scFont->ref.ref(); never executed: scFont->ref.ref(); | 0 | ||||||||||||||||||||||||
102 | } never executed: end of block | 0 | ||||||||||||||||||||||||
103 | - | |||||||||||||||||||||||||
104 | QFontPrivate::~QFontPrivate() | - | ||||||||||||||||||||||||
105 | { | - | ||||||||||||||||||||||||
106 | if (engineData
| 0 | ||||||||||||||||||||||||
107 | delete engineData; never executed: delete engineData; | 0 | ||||||||||||||||||||||||
108 | engineData = 0; | - | ||||||||||||||||||||||||
109 | if (scFont
| 0 | ||||||||||||||||||||||||
110 | scFont->ref.deref(); never executed: scFont->ref.deref(); | 0 | ||||||||||||||||||||||||
111 | scFont = 0; | - | ||||||||||||||||||||||||
112 | } never executed: end of block | 0 | ||||||||||||||||||||||||
113 | - | |||||||||||||||||||||||||
114 | extern QMutex *qt_fontdatabase_mutex(); | - | ||||||||||||||||||||||||
115 | - | |||||||||||||||||||||||||
116 | - | |||||||||||||||||||||||||
117 | - | |||||||||||||||||||||||||
118 | QFontEngine *QFontPrivate::engineForScript(int script) const | - | ||||||||||||||||||||||||
119 | { | - | ||||||||||||||||||||||||
120 | QMutexLocker locker(qt_fontdatabase_mutex()); | - | ||||||||||||||||||||||||
121 | if (script <= QChar::Script_Latin
| 0 | ||||||||||||||||||||||||
122 | script = QChar::Script_Common; never executed: script = QChar::Script_Common; | 0 | ||||||||||||||||||||||||
123 | if (engineData
| 0 | ||||||||||||||||||||||||
124 | - | |||||||||||||||||||||||||
125 | if (!engineData->ref.deref()
| 0 | ||||||||||||||||||||||||
126 | delete engineData; never executed: delete engineData; | 0 | ||||||||||||||||||||||||
127 | engineData = 0; | - | ||||||||||||||||||||||||
128 | } never executed: end of block | 0 | ||||||||||||||||||||||||
129 | if (!engineData
| 0 | ||||||||||||||||||||||||
130 | QFontDatabase::load(this, script); never executed: QFontDatabase::load(this, script); | 0 | ||||||||||||||||||||||||
131 | return never executed: engineData->engines[script];return engineData->engines[script]; never executed: return engineData->engines[script]; | 0 | ||||||||||||||||||||||||
132 | } | - | ||||||||||||||||||||||||
133 | - | |||||||||||||||||||||||||
134 | void QFontPrivate::alterCharForCapitalization(QChar &c) const { | - | ||||||||||||||||||||||||
135 | switch (capital) { | - | ||||||||||||||||||||||||
136 | case never executed: QFont::AllUppercase:case QFont::AllUppercase: never executed: case QFont::AllUppercase: | 0 | ||||||||||||||||||||||||
137 | case never executed: QFont::SmallCaps:case QFont::SmallCaps: never executed: case QFont::SmallCaps: | 0 | ||||||||||||||||||||||||
138 | c = c.toUpper(); | - | ||||||||||||||||||||||||
139 | break; never executed: break; | 0 | ||||||||||||||||||||||||
140 | case never executed: QFont::AllLowercase:case QFont::AllLowercase: never executed: case QFont::AllLowercase: | 0 | ||||||||||||||||||||||||
141 | c = c.toLower(); | - | ||||||||||||||||||||||||
142 | break; never executed: break; | 0 | ||||||||||||||||||||||||
143 | case never executed: QFont::MixedCase:case QFont::MixedCase: never executed: case QFont::MixedCase: | 0 | ||||||||||||||||||||||||
144 | break; never executed: break; | 0 | ||||||||||||||||||||||||
145 | } | - | ||||||||||||||||||||||||
146 | } never executed: end of block | 0 | ||||||||||||||||||||||||
147 | - | |||||||||||||||||||||||||
148 | QFontPrivate *QFontPrivate::smallCapsFontPrivate() const | - | ||||||||||||||||||||||||
149 | { | - | ||||||||||||||||||||||||
150 | if (scFont
| 0 | ||||||||||||||||||||||||
151 | return never executed: scFont;return scFont; never executed: return scFont; | 0 | ||||||||||||||||||||||||
152 | QFont font(const_cast<QFontPrivate *>(this)); | - | ||||||||||||||||||||||||
153 | qreal pointSize = font.pointSizeF(); | - | ||||||||||||||||||||||||
154 | if (pointSize > 0
| 0 | ||||||||||||||||||||||||
155 | font.setPointSizeF(pointSize * .7); never executed: font.setPointSizeF(pointSize * .7); | 0 | ||||||||||||||||||||||||
156 | else | - | ||||||||||||||||||||||||
157 | font.setPixelSize((font.pixelSize() * 7 + 5) / 10); never executed: font.setPixelSize((font.pixelSize() * 7 + 5) / 10); | 0 | ||||||||||||||||||||||||
158 | scFont = font.d.data(); | - | ||||||||||||||||||||||||
159 | if (scFont != this
| 0 | ||||||||||||||||||||||||
160 | scFont->ref.ref(); never executed: scFont->ref.ref(); | 0 | ||||||||||||||||||||||||
161 | return never executed: scFont;return scFont; never executed: return scFont; | 0 | ||||||||||||||||||||||||
162 | } | - | ||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||
165 | void QFontPrivate::resolve(uint mask, const QFontPrivate *other) | - | ||||||||||||||||||||||||
166 | { | - | ||||||||||||||||||||||||
167 | ((!(other != 0)) ? qt_assert("other != 0",__FILE__,251) : qt_noop()); | - | ||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||
169 | dpi = other->dpi; | - | ||||||||||||||||||||||||
170 | - | |||||||||||||||||||||||||
171 | if ((
never executed: return; | 0 | ||||||||||||||||||||||||
172 | - | |||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||
174 | if (! (mask & QFont::FamilyResolved)
| 0 | ||||||||||||||||||||||||
175 | request.family = other->request.family; never executed: request.family = other->request.family; | 0 | ||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||
177 | if (! (mask & QFont::StyleNameResolved)
| 0 | ||||||||||||||||||||||||
178 | request.styleName = other->request.styleName; never executed: request.styleName = other->request.styleName; | 0 | ||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||
180 | if (! (mask & QFont::SizeResolved)
| 0 | ||||||||||||||||||||||||
181 | request.pointSize = other->request.pointSize; | - | ||||||||||||||||||||||||
182 | request.pixelSize = other->request.pixelSize; | - | ||||||||||||||||||||||||
183 | } never executed: end of block | 0 | ||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||
185 | if (! (mask & QFont::StyleHintResolved)
| 0 | ||||||||||||||||||||||||
186 | request.styleHint = other->request.styleHint; never executed: request.styleHint = other->request.styleHint; | 0 | ||||||||||||||||||||||||
187 | - | |||||||||||||||||||||||||
188 | if (! (mask & QFont::StyleStrategyResolved)
| 0 | ||||||||||||||||||||||||
189 | request.styleStrategy = other->request.styleStrategy; never executed: request.styleStrategy = other->request.styleStrategy; | 0 | ||||||||||||||||||||||||
190 | - | |||||||||||||||||||||||||
191 | if (! (mask & QFont::WeightResolved)
| 0 | ||||||||||||||||||||||||
192 | request.weight = other->request.weight; never executed: request.weight = other->request.weight; | 0 | ||||||||||||||||||||||||
193 | - | |||||||||||||||||||||||||
194 | if (! (mask & QFont::StyleResolved)
| 0 | ||||||||||||||||||||||||
195 | request.style = other->request.style; never executed: request.style = other->request.style; | 0 | ||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||
197 | if (! (mask & QFont::FixedPitchResolved)
| 0 | ||||||||||||||||||||||||
198 | request.fixedPitch = other->request.fixedPitch; never executed: request.fixedPitch = other->request.fixedPitch; | 0 | ||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||
200 | if (! (mask & QFont::StretchResolved)
| 0 | ||||||||||||||||||||||||
201 | request.stretch = other->request.stretch; never executed: request.stretch = other->request.stretch; | 0 | ||||||||||||||||||||||||
202 | - | |||||||||||||||||||||||||
203 | if (! (mask & QFont::HintingPreferenceResolved)
| 0 | ||||||||||||||||||||||||
204 | request.hintingPreference = other->request.hintingPreference; never executed: request.hintingPreference = other->request.hintingPreference; | 0 | ||||||||||||||||||||||||
205 | - | |||||||||||||||||||||||||
206 | if (! (mask & QFont::UnderlineResolved)
| 0 | ||||||||||||||||||||||||
207 | underline = other->underline; never executed: underline = other->underline; | 0 | ||||||||||||||||||||||||
208 | - | |||||||||||||||||||||||||
209 | if (! (mask & QFont::OverlineResolved)
| 0 | ||||||||||||||||||||||||
210 | overline = other->overline; never executed: overline = other->overline; | 0 | ||||||||||||||||||||||||
211 | - | |||||||||||||||||||||||||
212 | if (! (mask & QFont::StrikeOutResolved)
| 0 | ||||||||||||||||||||||||
213 | strikeOut = other->strikeOut; never executed: strikeOut = other->strikeOut; | 0 | ||||||||||||||||||||||||
214 | - | |||||||||||||||||||||||||
215 | if (! (mask & QFont::KerningResolved)
| 0 | ||||||||||||||||||||||||
216 | kerning = other->kerning; never executed: kerning = other->kerning; | 0 | ||||||||||||||||||||||||
217 | - | |||||||||||||||||||||||||
218 | if (! (mask & QFont::LetterSpacingResolved)
| 0 | ||||||||||||||||||||||||
219 | letterSpacing = other->letterSpacing; | - | ||||||||||||||||||||||||
220 | letterSpacingIsAbsolute = other->letterSpacingIsAbsolute; | - | ||||||||||||||||||||||||
221 | } never executed: end of block | 0 | ||||||||||||||||||||||||
222 | if (! (mask & QFont::WordSpacingResolved)
| 0 | ||||||||||||||||||||||||
223 | wordSpacing = other->wordSpacing; never executed: wordSpacing = other->wordSpacing; | 0 | ||||||||||||||||||||||||
224 | if (! (mask & QFont::CapitalizationResolved)
| 0 | ||||||||||||||||||||||||
225 | capital = other->capital; never executed: capital = other->capital; | 0 | ||||||||||||||||||||||||
226 | } never executed: end of block | 0 | ||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | - | |||||||||||||||||||||||||
229 | - | |||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | QFontEngineData::QFontEngineData() | - | ||||||||||||||||||||||||
232 | : ref(0), fontCacheId(QFontCache::instance()->id()) | - | ||||||||||||||||||||||||
233 | { | - | ||||||||||||||||||||||||
234 | memset(engines, 0, QChar::ScriptCount * sizeof(QFontEngine *)); | - | ||||||||||||||||||||||||
235 | } never executed: end of block | 0 | ||||||||||||||||||||||||
236 | - | |||||||||||||||||||||||||
237 | QFontEngineData::~QFontEngineData() | - | ||||||||||||||||||||||||
238 | { | - | ||||||||||||||||||||||||
239 | ((!(ref.load() == 0)) ? qt_assert("ref.load() == 0",__FILE__,323) : qt_noop()); | - | ||||||||||||||||||||||||
240 | for (int i = 0; i < QChar::ScriptCount
| 0 | ||||||||||||||||||||||||
241 | if (engines[i]
| 0 | ||||||||||||||||||||||||
242 | if (!engines[i]->ref.deref()
| 0 | ||||||||||||||||||||||||
243 | delete engines[i]; never executed: delete engines[i]; | 0 | ||||||||||||||||||||||||
244 | engines[i] = 0; | - | ||||||||||||||||||||||||
245 | } never executed: end of block | 0 | ||||||||||||||||||||||||
246 | } never executed: end of block | 0 | ||||||||||||||||||||||||
247 | } never executed: end of block | 0 | ||||||||||||||||||||||||
248 | QFont::QFont(const QFont &font, QPaintDevice *pd) | - | ||||||||||||||||||||||||
249 | : resolve_mask(font.resolve_mask) | - | ||||||||||||||||||||||||
250 | { | - | ||||||||||||||||||||||||
251 | ((!(pd != 0)) ? qt_assert("pd != 0",__FILE__,546) : qt_noop()); | - | ||||||||||||||||||||||||
252 | int dpi = pd->logicalDpiY(); | - | ||||||||||||||||||||||||
253 | const int screen = 0; | - | ||||||||||||||||||||||||
254 | if (font.d->dpi != dpi
| 0 | ||||||||||||||||||||||||
255 | d = new QFontPrivate(*font.d); | - | ||||||||||||||||||||||||
256 | d->dpi = dpi; | - | ||||||||||||||||||||||||
257 | d->screen = screen; | - | ||||||||||||||||||||||||
258 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
259 | d = font.d.data(); | - | ||||||||||||||||||||||||
260 | } never executed: end of block | 0 | ||||||||||||||||||||||||
261 | } | - | ||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | - | |||||||||||||||||||||||||
264 | - | |||||||||||||||||||||||||
265 | - | |||||||||||||||||||||||||
266 | QFont::QFont(QFontPrivate *data) | - | ||||||||||||||||||||||||
267 | : d(data), resolve_mask(QFont::AllPropertiesResolved) | - | ||||||||||||||||||||||||
268 | { | - | ||||||||||||||||||||||||
269 | } never executed: end of block | 0 | ||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||
271 | - | |||||||||||||||||||||||||
272 | - | |||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||
274 | void QFont::detach() | - | ||||||||||||||||||||||||
275 | { | - | ||||||||||||||||||||||||
276 | if (d->ref.load() == 1
| 0 | ||||||||||||||||||||||||
277 | if (d->engineData
| 0 | ||||||||||||||||||||||||
278 | delete d->engineData; never executed: delete d->engineData; | 0 | ||||||||||||||||||||||||
279 | d->engineData = 0; | - | ||||||||||||||||||||||||
280 | if (d->scFont
| 0 | ||||||||||||||||||||||||
281 | d->scFont->ref.deref(); never executed: d->scFont->ref.deref(); | 0 | ||||||||||||||||||||||||
282 | d->scFont = 0; | - | ||||||||||||||||||||||||
283 | return; never executed: return; | 0 | ||||||||||||||||||||||||
284 | } | - | ||||||||||||||||||||||||
285 | - | |||||||||||||||||||||||||
286 | d.detach(); | - | ||||||||||||||||||||||||
287 | } never executed: end of block | 0 | ||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||
290 | - | |||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||
292 | - | |||||||||||||||||||||||||
293 | - | |||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||
295 | void QFontPrivate::detachButKeepEngineData(QFont *font) | - | ||||||||||||||||||||||||
296 | { | - | ||||||||||||||||||||||||
297 | if (font->d->ref.load() == 1
| 0 | ||||||||||||||||||||||||
298 | return; never executed: return; | 0 | ||||||||||||||||||||||||
299 | - | |||||||||||||||||||||||||
300 | QFontEngineData *engineData = font->d->engineData; | - | ||||||||||||||||||||||||
301 | if (engineData
| 0 | ||||||||||||||||||||||||
302 | engineData->ref.ref(); never executed: engineData->ref.ref(); | 0 | ||||||||||||||||||||||||
303 | font->d.detach(); | - | ||||||||||||||||||||||||
304 | font->d->engineData = engineData; | - | ||||||||||||||||||||||||
305 | } never executed: end of block | 0 | ||||||||||||||||||||||||
306 | - | |||||||||||||||||||||||||
307 | - | |||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||
309 | - | |||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||
311 | - | |||||||||||||||||||||||||
312 | QFont::QFont() | - | ||||||||||||||||||||||||
313 | : d(QGuiApplicationPrivate::instance() ? QGuiApplication::font().d.data() : new QFontPrivate()), resolve_mask(0) | - | ||||||||||||||||||||||||
314 | { | - | ||||||||||||||||||||||||
315 | } never executed: end of block | 0 | ||||||||||||||||||||||||
316 | QFont::QFont(const QString &family, int pointSize, int weight, bool italic) | - | ||||||||||||||||||||||||
317 | : d(new QFontPrivate()), resolve_mask(QFont::FamilyResolved) | - | ||||||||||||||||||||||||
318 | { | - | ||||||||||||||||||||||||
319 | if (pointSize <= 0
| 0 | ||||||||||||||||||||||||
320 | pointSize = 12; | - | ||||||||||||||||||||||||
321 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
322 | resolve_mask |= QFont::SizeResolved; | - | ||||||||||||||||||||||||
323 | } never executed: end of block | 0 | ||||||||||||||||||||||||
324 | - | |||||||||||||||||||||||||
325 | if (weight < 0
| 0 | ||||||||||||||||||||||||
326 | weight = Normal; | - | ||||||||||||||||||||||||
327 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
328 | resolve_mask |= QFont::WeightResolved | QFont::StyleResolved; | - | ||||||||||||||||||||||||
329 | } never executed: end of block | 0 | ||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||
331 | if (italic
| 0 | ||||||||||||||||||||||||
332 | resolve_mask |= QFont::StyleResolved; never executed: resolve_mask |= QFont::StyleResolved; | 0 | ||||||||||||||||||||||||
333 | - | |||||||||||||||||||||||||
334 | d->request.family = family; | - | ||||||||||||||||||||||||
335 | d->request.pointSize = qreal(pointSize); | - | ||||||||||||||||||||||||
336 | d->request.pixelSize = -1; | - | ||||||||||||||||||||||||
337 | d->request.weight = weight; | - | ||||||||||||||||||||||||
338 | d->request.style = italic
| 0 | ||||||||||||||||||||||||
339 | } never executed: end of block | 0 | ||||||||||||||||||||||||
340 | - | |||||||||||||||||||||||||
341 | - | |||||||||||||||||||||||||
342 | - | |||||||||||||||||||||||||
343 | - | |||||||||||||||||||||||||
344 | QFont::QFont(const QFont &font) | - | ||||||||||||||||||||||||
345 | : d(font.d.data()), resolve_mask(font.resolve_mask) | - | ||||||||||||||||||||||||
346 | { | - | ||||||||||||||||||||||||
347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
348 | - | |||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||
351 | - | |||||||||||||||||||||||||
352 | QFont::~QFont() | - | ||||||||||||||||||||||||
353 | { | - | ||||||||||||||||||||||||
354 | } | - | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||
357 | - | |||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||
359 | QFont &QFont::operator=(const QFont &font) | - | ||||||||||||||||||||||||
360 | { | - | ||||||||||||||||||||||||
361 | d = font.d.data(); | - | ||||||||||||||||||||||||
362 | resolve_mask = font.resolve_mask; | - | ||||||||||||||||||||||||
363 | return never executed: *this;return *this; never executed: return *this; | 0 | ||||||||||||||||||||||||
364 | } | - | ||||||||||||||||||||||||
365 | QString QFont::family() const | - | ||||||||||||||||||||||||
366 | { | - | ||||||||||||||||||||||||
367 | return never executed: d->request.family;return d->request.family; never executed: return d->request.family; | 0 | ||||||||||||||||||||||||
368 | } | - | ||||||||||||||||||||||||
369 | void QFont::setFamily(const QString &family) | - | ||||||||||||||||||||||||
370 | { | - | ||||||||||||||||||||||||
371 | if ((
| 0 | ||||||||||||||||||||||||
372 | return; never executed: return; | 0 | ||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||
374 | detach(); | - | ||||||||||||||||||||||||
375 | - | |||||||||||||||||||||||||
376 | d->request.family = family; | - | ||||||||||||||||||||||||
377 | - | |||||||||||||||||||||||||
378 | resolve_mask |= QFont::FamilyResolved; | - | ||||||||||||||||||||||||
379 | } never executed: end of block | 0 | ||||||||||||||||||||||||
380 | QString QFont::styleName() const | - | ||||||||||||||||||||||||
381 | { | - | ||||||||||||||||||||||||
382 | return never executed: d->request.styleName;return d->request.styleName; never executed: return d->request.styleName; | 0 | ||||||||||||||||||||||||
383 | } | - | ||||||||||||||||||||||||
384 | void QFont::setStyleName(const QString &styleName) | - | ||||||||||||||||||||||||
385 | { | - | ||||||||||||||||||||||||
386 | if ((
| 0 | ||||||||||||||||||||||||
387 | return; never executed: return; | 0 | ||||||||||||||||||||||||
388 | - | |||||||||||||||||||||||||
389 | detach(); | - | ||||||||||||||||||||||||
390 | - | |||||||||||||||||||||||||
391 | d->request.styleName = styleName; | - | ||||||||||||||||||||||||
392 | resolve_mask |= QFont::StyleNameResolved; | - | ||||||||||||||||||||||||
393 | } never executed: end of block | 0 | ||||||||||||||||||||||||
394 | - | |||||||||||||||||||||||||
395 | - | |||||||||||||||||||||||||
396 | - | |||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||
399 | - | |||||||||||||||||||||||||
400 | - | |||||||||||||||||||||||||
401 | int QFont::pointSize() const | - | ||||||||||||||||||||||||
402 | { | - | ||||||||||||||||||||||||
403 | return never executed: qRound(d->request.pointSize);return qRound(d->request.pointSize); never executed: return qRound(d->request.pointSize); | 0 | ||||||||||||||||||||||||
404 | } | - | ||||||||||||||||||||||||
405 | void QFont::setHintingPreference(HintingPreference hintingPreference) | - | ||||||||||||||||||||||||
406 | { | - | ||||||||||||||||||||||||
407 | if ((
| 0 | ||||||||||||||||||||||||
408 | return; never executed: return; | 0 | ||||||||||||||||||||||||
409 | - | |||||||||||||||||||||||||
410 | detach(); | - | ||||||||||||||||||||||||
411 | - | |||||||||||||||||||||||||
412 | d->request.hintingPreference = hintingPreference; | - | ||||||||||||||||||||||||
413 | - | |||||||||||||||||||||||||
414 | resolve_mask |= QFont::HintingPreferenceResolved; | - | ||||||||||||||||||||||||
415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
416 | - | |||||||||||||||||||||||||
417 | - | |||||||||||||||||||||||||
418 | - | |||||||||||||||||||||||||
419 | - | |||||||||||||||||||||||||
420 | - | |||||||||||||||||||||||||
421 | - | |||||||||||||||||||||||||
422 | QFont::HintingPreference QFont::hintingPreference() const | - | ||||||||||||||||||||||||
423 | { | - | ||||||||||||||||||||||||
424 | return never executed: QFont::HintingPreference(d->request.hintingPreference);return QFont::HintingPreference(d->request.hintingPreference); never executed: return QFont::HintingPreference(d->request.hintingPreference); | 0 | ||||||||||||||||||||||||
425 | } | - | ||||||||||||||||||||||||
426 | - | |||||||||||||||||||||||||
427 | - | |||||||||||||||||||||||||
428 | - | |||||||||||||||||||||||||
429 | - | |||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||
431 | - | |||||||||||||||||||||||||
432 | - | |||||||||||||||||||||||||
433 | void QFont::setPointSize(int pointSize) | - | ||||||||||||||||||||||||
434 | { | - | ||||||||||||||||||||||||
435 | if (pointSize <= 0
| 0 | ||||||||||||||||||||||||
436 | QMessageLogger(__FILE__, 881, __PRETTY_FUNCTION__).warning("QFont::setPointSize: Point size <= 0 (%d), must be greater than 0", pointSize); | - | ||||||||||||||||||||||||
437 | return; never executed: return; | 0 | ||||||||||||||||||||||||
438 | } | - | ||||||||||||||||||||||||
439 | - | |||||||||||||||||||||||||
440 | if ((
| 0 | ||||||||||||||||||||||||
441 | return; never executed: return; | 0 | ||||||||||||||||||||||||
442 | - | |||||||||||||||||||||||||
443 | detach(); | - | ||||||||||||||||||||||||
444 | - | |||||||||||||||||||||||||
445 | d->request.pointSize = qreal(pointSize); | - | ||||||||||||||||||||||||
446 | d->request.pixelSize = -1; | - | ||||||||||||||||||||||||
447 | - | |||||||||||||||||||||||||
448 | resolve_mask |= QFont::SizeResolved; | - | ||||||||||||||||||||||||
449 | } never executed: end of block | 0 | ||||||||||||||||||||||||
450 | void QFont::setPointSizeF(qreal pointSize) | - | ||||||||||||||||||||||||
451 | { | - | ||||||||||||||||||||||||
452 | if (pointSize <= 0
| 0 | ||||||||||||||||||||||||
453 | QMessageLogger(__FILE__, 906, __PRETTY_FUNCTION__).warning("QFont::setPointSizeF: Point size <= 0 (%f), must be greater than 0", pointSize); | - | ||||||||||||||||||||||||
454 | return; never executed: return; | 0 | ||||||||||||||||||||||||
455 | } | - | ||||||||||||||||||||||||
456 | - | |||||||||||||||||||||||||
457 | if ((
| 0 | ||||||||||||||||||||||||
458 | return; never executed: return; | 0 | ||||||||||||||||||||||||
459 | - | |||||||||||||||||||||||||
460 | detach(); | - | ||||||||||||||||||||||||
461 | - | |||||||||||||||||||||||||
462 | d->request.pointSize = pointSize; | - | ||||||||||||||||||||||||
463 | d->request.pixelSize = -1; | - | ||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||
465 | resolve_mask |= QFont::SizeResolved; | - | ||||||||||||||||||||||||
466 | } never executed: end of block | 0 | ||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||
468 | - | |||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||
470 | - | |||||||||||||||||||||||||
471 | - | |||||||||||||||||||||||||
472 | - | |||||||||||||||||||||||||
473 | - | |||||||||||||||||||||||||
474 | qreal QFont::pointSizeF() const | - | ||||||||||||||||||||||||
475 | { | - | ||||||||||||||||||||||||
476 | return never executed: d->request.pointSize;return d->request.pointSize; never executed: return d->request.pointSize; | 0 | ||||||||||||||||||||||||
477 | } | - | ||||||||||||||||||||||||
478 | void QFont::setPixelSize(int pixelSize) | - | ||||||||||||||||||||||||
479 | { | - | ||||||||||||||||||||||||
480 | if (pixelSize <= 0
| 0 | ||||||||||||||||||||||||
481 | QMessageLogger(__FILE__, 944, __PRETTY_FUNCTION__).warning("QFont::setPixelSize: Pixel size <= 0 (%d)", pixelSize); | - | ||||||||||||||||||||||||
482 | return; never executed: return; | 0 | ||||||||||||||||||||||||
483 | } | - | ||||||||||||||||||||||||
484 | - | |||||||||||||||||||||||||
485 | if ((
| 0 | ||||||||||||||||||||||||
486 | return; never executed: return; | 0 | ||||||||||||||||||||||||
487 | - | |||||||||||||||||||||||||
488 | detach(); | - | ||||||||||||||||||||||||
489 | - | |||||||||||||||||||||||||
490 | d->request.pixelSize = pixelSize; | - | ||||||||||||||||||||||||
491 | d->request.pointSize = -1; | - | ||||||||||||||||||||||||
492 | - | |||||||||||||||||||||||||
493 | resolve_mask |= QFont::SizeResolved; | - | ||||||||||||||||||||||||
494 | } never executed: end of block | 0 | ||||||||||||||||||||||||
495 | int QFont::pixelSize() const | - | ||||||||||||||||||||||||
496 | { | - | ||||||||||||||||||||||||
497 | return never executed: d->request.pixelSize;return d->request.pixelSize; never executed: return d->request.pixelSize; | 0 | ||||||||||||||||||||||||
498 | } | - | ||||||||||||||||||||||||
499 | QFont::Style QFont::style() const | - | ||||||||||||||||||||||||
500 | { | - | ||||||||||||||||||||||||
501 | return never executed: (QFont::Style)d->request.style;return (QFont::Style)d->request.style; never executed: return (QFont::Style)d->request.style; | 0 | ||||||||||||||||||||||||
502 | } | - | ||||||||||||||||||||||||
503 | - | |||||||||||||||||||||||||
504 | - | |||||||||||||||||||||||||
505 | - | |||||||||||||||||||||||||
506 | - | |||||||||||||||||||||||||
507 | - | |||||||||||||||||||||||||
508 | - | |||||||||||||||||||||||||
509 | - | |||||||||||||||||||||||||
510 | void QFont::setStyle(Style style) | - | ||||||||||||||||||||||||
511 | { | - | ||||||||||||||||||||||||
512 | if ((
| 0 | ||||||||||||||||||||||||
513 | return; never executed: return; | 0 | ||||||||||||||||||||||||
514 | - | |||||||||||||||||||||||||
515 | detach(); | - | ||||||||||||||||||||||||
516 | - | |||||||||||||||||||||||||
517 | d->request.style = style; | - | ||||||||||||||||||||||||
518 | resolve_mask |= QFont::StyleResolved; | - | ||||||||||||||||||||||||
519 | } never executed: end of block | 0 | ||||||||||||||||||||||||
520 | - | |||||||||||||||||||||||||
521 | - | |||||||||||||||||||||||||
522 | - | |||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||
524 | - | |||||||||||||||||||||||||
525 | - | |||||||||||||||||||||||||
526 | - | |||||||||||||||||||||||||
527 | int QFont::weight() const | - | ||||||||||||||||||||||||
528 | { | - | ||||||||||||||||||||||||
529 | return never executed: d->request.weight;return d->request.weight; never executed: return d->request.weight; | 0 | ||||||||||||||||||||||||
530 | } | - | ||||||||||||||||||||||||
531 | void QFont::setWeight(int weight) | - | ||||||||||||||||||||||||
532 | { | - | ||||||||||||||||||||||||
533 | ((!(weight >= 0 && weight <= 99)) ? qt_assert_x("QFont::setWeight", "Weight must be between 0 and 99",__FILE__,1054) : qt_noop()); | - | ||||||||||||||||||||||||
534 | - | |||||||||||||||||||||||||
535 | if ((
| 0 | ||||||||||||||||||||||||
536 | return; never executed: return; | 0 | ||||||||||||||||||||||||
537 | - | |||||||||||||||||||||||||
538 | detach(); | - | ||||||||||||||||||||||||
539 | - | |||||||||||||||||||||||||
540 | d->request.weight = weight; | - | ||||||||||||||||||||||||
541 | resolve_mask |= QFont::WeightResolved; | - | ||||||||||||||||||||||||
542 | } never executed: end of block | 0 | ||||||||||||||||||||||||
543 | bool QFont::underline() const | - | ||||||||||||||||||||||||
544 | { | - | ||||||||||||||||||||||||
545 | return never executed: d->underline;return d->underline; never executed: return d->underline; | 0 | ||||||||||||||||||||||||
546 | } | - | ||||||||||||||||||||||||
547 | - | |||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||
553 | - | |||||||||||||||||||||||||
554 | void QFont::setUnderline(bool enable) | - | ||||||||||||||||||||||||
555 | { | - | ||||||||||||||||||||||||
556 | if ((
| 0 | ||||||||||||||||||||||||
557 | return; never executed: return; | 0 | ||||||||||||||||||||||||
558 | - | |||||||||||||||||||||||||
559 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
560 | - | |||||||||||||||||||||||||
561 | d->underline = enable; | - | ||||||||||||||||||||||||
562 | resolve_mask |= QFont::UnderlineResolved; | - | ||||||||||||||||||||||||
563 | } never executed: end of block | 0 | ||||||||||||||||||||||||
564 | - | |||||||||||||||||||||||||
565 | - | |||||||||||||||||||||||||
566 | - | |||||||||||||||||||||||||
567 | - | |||||||||||||||||||||||||
568 | - | |||||||||||||||||||||||||
569 | - | |||||||||||||||||||||||||
570 | bool QFont::overline() const | - | ||||||||||||||||||||||||
571 | { | - | ||||||||||||||||||||||||
572 | return never executed: d->overline;return d->overline; never executed: return d->overline; | 0 | ||||||||||||||||||||||||
573 | } | - | ||||||||||||||||||||||||
574 | - | |||||||||||||||||||||||||
575 | - | |||||||||||||||||||||||||
576 | - | |||||||||||||||||||||||||
577 | - | |||||||||||||||||||||||||
578 | - | |||||||||||||||||||||||||
579 | - | |||||||||||||||||||||||||
580 | void QFont::setOverline(bool enable) | - | ||||||||||||||||||||||||
581 | { | - | ||||||||||||||||||||||||
582 | if ((
| 0 | ||||||||||||||||||||||||
583 | return; never executed: return; | 0 | ||||||||||||||||||||||||
584 | - | |||||||||||||||||||||||||
585 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
586 | - | |||||||||||||||||||||||||
587 | d->overline = enable; | - | ||||||||||||||||||||||||
588 | resolve_mask |= QFont::OverlineResolved; | - | ||||||||||||||||||||||||
589 | } never executed: end of block | 0 | ||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||
592 | - | |||||||||||||||||||||||||
593 | - | |||||||||||||||||||||||||
594 | - | |||||||||||||||||||||||||
595 | - | |||||||||||||||||||||||||
596 | bool QFont::strikeOut() const | - | ||||||||||||||||||||||||
597 | { | - | ||||||||||||||||||||||||
598 | return never executed: d->strikeOut;return d->strikeOut; never executed: return d->strikeOut; | 0 | ||||||||||||||||||||||||
599 | } | - | ||||||||||||||||||||||||
600 | - | |||||||||||||||||||||||||
601 | - | |||||||||||||||||||||||||
602 | - | |||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||
604 | - | |||||||||||||||||||||||||
605 | - | |||||||||||||||||||||||||
606 | - | |||||||||||||||||||||||||
607 | void QFont::setStrikeOut(bool enable) | - | ||||||||||||||||||||||||
608 | { | - | ||||||||||||||||||||||||
609 | if ((
| 0 | ||||||||||||||||||||||||
610 | return; never executed: return; | 0 | ||||||||||||||||||||||||
611 | - | |||||||||||||||||||||||||
612 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
613 | - | |||||||||||||||||||||||||
614 | d->strikeOut = enable; | - | ||||||||||||||||||||||||
615 | resolve_mask |= QFont::StrikeOutResolved; | - | ||||||||||||||||||||||||
616 | } never executed: end of block | 0 | ||||||||||||||||||||||||
617 | - | |||||||||||||||||||||||||
618 | - | |||||||||||||||||||||||||
619 | - | |||||||||||||||||||||||||
620 | - | |||||||||||||||||||||||||
621 | - | |||||||||||||||||||||||||
622 | - | |||||||||||||||||||||||||
623 | bool QFont::fixedPitch() const | - | ||||||||||||||||||||||||
624 | { | - | ||||||||||||||||||||||||
625 | return never executed: d->request.fixedPitch;return d->request.fixedPitch; never executed: return d->request.fixedPitch; | 0 | ||||||||||||||||||||||||
626 | } | - | ||||||||||||||||||||||||
627 | - | |||||||||||||||||||||||||
628 | - | |||||||||||||||||||||||||
629 | - | |||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||
634 | void QFont::setFixedPitch(bool enable) | - | ||||||||||||||||||||||||
635 | { | - | ||||||||||||||||||||||||
636 | if ((
| 0 | ||||||||||||||||||||||||
637 | return; never executed: return; | 0 | ||||||||||||||||||||||||
638 | - | |||||||||||||||||||||||||
639 | detach(); | - | ||||||||||||||||||||||||
640 | - | |||||||||||||||||||||||||
641 | d->request.fixedPitch = enable; | - | ||||||||||||||||||||||||
642 | d->request.ignorePitch = false; | - | ||||||||||||||||||||||||
643 | resolve_mask |= QFont::FixedPitchResolved; | - | ||||||||||||||||||||||||
644 | } never executed: end of block | 0 | ||||||||||||||||||||||||
645 | - | |||||||||||||||||||||||||
646 | - | |||||||||||||||||||||||||
647 | - | |||||||||||||||||||||||||
648 | - | |||||||||||||||||||||||||
649 | - | |||||||||||||||||||||||||
650 | - | |||||||||||||||||||||||||
651 | bool QFont::kerning() const | - | ||||||||||||||||||||||||
652 | { | - | ||||||||||||||||||||||||
653 | return never executed: d->kerning;return d->kerning; never executed: return d->kerning; | 0 | ||||||||||||||||||||||||
654 | } | - | ||||||||||||||||||||||||
655 | void QFont::setKerning(bool enable) | - | ||||||||||||||||||||||||
656 | { | - | ||||||||||||||||||||||||
657 | if ((
| 0 | ||||||||||||||||||||||||
658 | return; never executed: return; | 0 | ||||||||||||||||||||||||
659 | - | |||||||||||||||||||||||||
660 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
661 | - | |||||||||||||||||||||||||
662 | d->kerning = enable; | - | ||||||||||||||||||||||||
663 | resolve_mask |= QFont::KerningResolved; | - | ||||||||||||||||||||||||
664 | } never executed: end of block | 0 | ||||||||||||||||||||||||
665 | QFont::StyleStrategy QFont::styleStrategy() const | - | ||||||||||||||||||||||||
666 | { | - | ||||||||||||||||||||||||
667 | return never executed: (StyleStrategy) d->request.styleStrategy;return (StyleStrategy) d->request.styleStrategy; never executed: return (StyleStrategy) d->request.styleStrategy; | 0 | ||||||||||||||||||||||||
668 | } | - | ||||||||||||||||||||||||
669 | QFont::StyleHint QFont::styleHint() const | - | ||||||||||||||||||||||||
670 | { | - | ||||||||||||||||||||||||
671 | return never executed: (StyleHint) d->request.styleHint;return (StyleHint) d->request.styleHint; never executed: return (StyleHint) d->request.styleHint; | 0 | ||||||||||||||||||||||||
672 | } | - | ||||||||||||||||||||||||
673 | void QFont::setStyleHint(StyleHint hint, StyleStrategy strategy) | - | ||||||||||||||||||||||||
674 | { | - | ||||||||||||||||||||||||
675 | if ((
| 0 | ||||||||||||||||||||||||
676 | (
| 0 | ||||||||||||||||||||||||
677 | (
| 0 | ||||||||||||||||||||||||
678 | return; never executed: return; | 0 | ||||||||||||||||||||||||
679 | - | |||||||||||||||||||||||||
680 | detach(); | - | ||||||||||||||||||||||||
681 | - | |||||||||||||||||||||||||
682 | d->request.styleHint = hint; | - | ||||||||||||||||||||||||
683 | d->request.styleStrategy = strategy; | - | ||||||||||||||||||||||||
684 | resolve_mask |= QFont::StyleHintResolved; | - | ||||||||||||||||||||||||
685 | resolve_mask |= QFont::StyleStrategyResolved; | - | ||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||
687 | } never executed: end of block | 0 | ||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||
689 | - | |||||||||||||||||||||||||
690 | - | |||||||||||||||||||||||||
691 | - | |||||||||||||||||||||||||
692 | - | |||||||||||||||||||||||||
693 | - | |||||||||||||||||||||||||
694 | void QFont::setStyleStrategy(StyleStrategy s) | - | ||||||||||||||||||||||||
695 | { | - | ||||||||||||||||||||||||
696 | if ((
| 0 | ||||||||||||||||||||||||
697 | s == (StyleStrategy)d->request.styleStrategy
| 0 | ||||||||||||||||||||||||
698 | return; never executed: return; | 0 | ||||||||||||||||||||||||
699 | - | |||||||||||||||||||||||||
700 | detach(); | - | ||||||||||||||||||||||||
701 | - | |||||||||||||||||||||||||
702 | d->request.styleStrategy = s; | - | ||||||||||||||||||||||||
703 | resolve_mask |= QFont::StyleStrategyResolved; | - | ||||||||||||||||||||||||
704 | } never executed: end of block | 0 | ||||||||||||||||||||||||
705 | int QFont::stretch() const | - | ||||||||||||||||||||||||
706 | { | - | ||||||||||||||||||||||||
707 | return never executed: d->request.stretch;return d->request.stretch; never executed: return d->request.stretch; | 0 | ||||||||||||||||||||||||
708 | } | - | ||||||||||||||||||||||||
709 | void QFont::setStretch(int factor) | - | ||||||||||||||||||||||||
710 | { | - | ||||||||||||||||||||||||
711 | if (factor < 1
| 0 | ||||||||||||||||||||||||
712 | QMessageLogger(__FILE__, 1416, __PRETTY_FUNCTION__).warning("QFont::setStretch: Parameter '%d' out of range", factor); | - | ||||||||||||||||||||||||
713 | return; never executed: return; | 0 | ||||||||||||||||||||||||
714 | } | - | ||||||||||||||||||||||||
715 | - | |||||||||||||||||||||||||
716 | if ((
| 0 | ||||||||||||||||||||||||
717 | d->request.stretch == (uint)factor
| 0 | ||||||||||||||||||||||||
718 | return; never executed: return; | 0 | ||||||||||||||||||||||||
719 | - | |||||||||||||||||||||||||
720 | detach(); | - | ||||||||||||||||||||||||
721 | - | |||||||||||||||||||||||||
722 | d->request.stretch = (uint)factor; | - | ||||||||||||||||||||||||
723 | resolve_mask |= QFont::StretchResolved; | - | ||||||||||||||||||||||||
724 | } never executed: end of block | 0 | ||||||||||||||||||||||||
725 | qreal QFont::letterSpacing() const | - | ||||||||||||||||||||||||
726 | { | - | ||||||||||||||||||||||||
727 | return never executed: d->letterSpacing.toReal();return d->letterSpacing.toReal(); never executed: return d->letterSpacing.toReal(); | 0 | ||||||||||||||||||||||||
728 | } | - | ||||||||||||||||||||||||
729 | void QFont::setLetterSpacing(SpacingType type, qreal spacing) | - | ||||||||||||||||||||||||
730 | { | - | ||||||||||||||||||||||||
731 | const QFixed newSpacing = QFixed::fromReal(spacing); | - | ||||||||||||||||||||||||
732 | const bool absoluteSpacing = type == AbsoluteSpacing; | - | ||||||||||||||||||||||||
733 | if ((
| 0 | ||||||||||||||||||||||||
734 | d->letterSpacingIsAbsolute == absoluteSpacing
| 0 | ||||||||||||||||||||||||
735 | d->letterSpacing == newSpacing
| 0 | ||||||||||||||||||||||||
736 | return; never executed: return; | 0 | ||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||
738 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||
740 | d->letterSpacing = newSpacing; | - | ||||||||||||||||||||||||
741 | d->letterSpacingIsAbsolute = absoluteSpacing; | - | ||||||||||||||||||||||||
742 | resolve_mask |= QFont::LetterSpacingResolved; | - | ||||||||||||||||||||||||
743 | } never executed: end of block | 0 | ||||||||||||||||||||||||
744 | - | |||||||||||||||||||||||||
745 | - | |||||||||||||||||||||||||
746 | - | |||||||||||||||||||||||||
747 | - | |||||||||||||||||||||||||
748 | - | |||||||||||||||||||||||||
749 | - | |||||||||||||||||||||||||
750 | - | |||||||||||||||||||||||||
751 | QFont::SpacingType QFont::letterSpacingType() const | - | ||||||||||||||||||||||||
752 | { | - | ||||||||||||||||||||||||
753 | return never executed: d->letterSpacingIsAbsolutereturn d->letterSpacingIsAbsolute ? AbsoluteSpacing : PercentageSpacing;
never executed: return d->letterSpacingIsAbsolute ? AbsoluteSpacing : PercentageSpacing; | 0 | ||||||||||||||||||||||||
754 | } | - | ||||||||||||||||||||||||
755 | - | |||||||||||||||||||||||||
756 | - | |||||||||||||||||||||||||
757 | - | |||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||
760 | - | |||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||
762 | qreal QFont::wordSpacing() const | - | ||||||||||||||||||||||||
763 | { | - | ||||||||||||||||||||||||
764 | return never executed: d->wordSpacing.toReal();return d->wordSpacing.toReal(); never executed: return d->wordSpacing.toReal(); | 0 | ||||||||||||||||||||||||
765 | } | - | ||||||||||||||||||||||||
766 | void QFont::setWordSpacing(qreal spacing) | - | ||||||||||||||||||||||||
767 | { | - | ||||||||||||||||||||||||
768 | const QFixed newSpacing = QFixed::fromReal(spacing); | - | ||||||||||||||||||||||||
769 | if ((
| 0 | ||||||||||||||||||||||||
770 | d->wordSpacing == newSpacing
| 0 | ||||||||||||||||||||||||
771 | return; never executed: return; | 0 | ||||||||||||||||||||||||
772 | - | |||||||||||||||||||||||||
773 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
774 | - | |||||||||||||||||||||||||
775 | d->wordSpacing = newSpacing; | - | ||||||||||||||||||||||||
776 | resolve_mask |= QFont::WordSpacingResolved; | - | ||||||||||||||||||||||||
777 | } never executed: end of block | 0 | ||||||||||||||||||||||||
778 | void QFont::setCapitalization(Capitalization caps) | - | ||||||||||||||||||||||||
779 | { | - | ||||||||||||||||||||||||
780 | if ((
| 0 | ||||||||||||||||||||||||
781 | capitalization() == caps
| 0 | ||||||||||||||||||||||||
782 | return; never executed: return; | 0 | ||||||||||||||||||||||||
783 | - | |||||||||||||||||||||||||
784 | QFontPrivate::detachButKeepEngineData(this); | - | ||||||||||||||||||||||||
785 | - | |||||||||||||||||||||||||
786 | d->capital = caps; | - | ||||||||||||||||||||||||
787 | resolve_mask |= QFont::CapitalizationResolved; | - | ||||||||||||||||||||||||
788 | } never executed: end of block | 0 | ||||||||||||||||||||||||
789 | - | |||||||||||||||||||||||||
790 | - | |||||||||||||||||||||||||
791 | - | |||||||||||||||||||||||||
792 | - | |||||||||||||||||||||||||
793 | - | |||||||||||||||||||||||||
794 | - | |||||||||||||||||||||||||
795 | - | |||||||||||||||||||||||||
796 | QFont::Capitalization QFont::capitalization() const | - | ||||||||||||||||||||||||
797 | { | - | ||||||||||||||||||||||||
798 | return never executed: static_cast<QFont::Capitalization> (d->capital);return static_cast<QFont::Capitalization> (d->capital); never executed: return static_cast<QFont::Capitalization> (d->capital); | 0 | ||||||||||||||||||||||||
799 | } | - | ||||||||||||||||||||||||
800 | void QFont::setRawMode(bool) | - | ||||||||||||||||||||||||
801 | { | - | ||||||||||||||||||||||||
802 | } | - | ||||||||||||||||||||||||
803 | bool QFont::exactMatch() const | - | ||||||||||||||||||||||||
804 | { | - | ||||||||||||||||||||||||
805 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
806 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,1607) : qt_noop()); | - | ||||||||||||||||||||||||
807 | return never executed: d->request.exactMatch(engine->fontDef);return d->request.exactMatch(engine->fontDef); never executed: return d->request.exactMatch(engine->fontDef); | 0 | ||||||||||||||||||||||||
808 | } | - | ||||||||||||||||||||||||
809 | bool QFont::operator==(const QFont &f) const | - | ||||||||||||||||||||||||
810 | { | - | ||||||||||||||||||||||||
811 | return never executed: (f.d == dreturn (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing ));
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
812 | || (f.d->request == d->request
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
813 | && f.d->request.pointSize == d->request.pointSize
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
814 | && f.d->underline == d->underline
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
815 | && f.d->overline == d->overline
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
816 | && f.d->strikeOut == d->strikeOut
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
817 | && f.d->kerning == d->kerning
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
818 | && f.d->capital == d->capital
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
819 | && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
820 | && f.d->letterSpacing == d->letterSpacing
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
821 | && f.d->wordSpacing == d->wordSpacing
never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
822 | )); never executed: return (f.d == d || (f.d->request == d->request && f.d->request.pointSize == d->request.pointSize && f.d->underline == d->underline && f.d->overline == d->overline && f.d->strikeOut == d->strikeOut && f.d->kerning == d->kerning && f.d->capital == d->capital && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute && f.d->letterSpacing == d->letterSpacing && f.d->wordSpacing == d->wordSpacing )); | 0 | ||||||||||||||||||||||||
823 | } | - | ||||||||||||||||||||||||
824 | bool QFont::operator<(const QFont &f) const | - | ||||||||||||||||||||||||
825 | { | - | ||||||||||||||||||||||||
826 | if (f.d == d
never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||
828 | QFontDef &r1 = f.d->request; | - | ||||||||||||||||||||||||
829 | QFontDef &r2 = d->request; | - | ||||||||||||||||||||||||
830 | if (r1.pointSize != r2.pointSize
never executed: r1.pointSize < r2.pointSize;return r1.pointSize < r2.pointSize; never executed: return r1.pointSize < r2.pointSize; | 0 | ||||||||||||||||||||||||
831 | if (r1.pixelSize != r2.pixelSize
never executed: r1.pixelSize < r2.pixelSize;return r1.pixelSize < r2.pixelSize; never executed: return r1.pixelSize < r2.pixelSize; | 0 | ||||||||||||||||||||||||
832 | if (r1.weight != r2.weight
never executed: r1.weight < r2.weight;return r1.weight < r2.weight; never executed: return r1.weight < r2.weight; | 0 | ||||||||||||||||||||||||
833 | if (r1.style != r2.style
never executed: r1.style < r2.style;return r1.style < r2.style; never executed: return r1.style < r2.style; | 0 | ||||||||||||||||||||||||
834 | if (r1.stretch != r2.stretch
never executed: r1.stretch < r2.stretch;return r1.stretch < r2.stretch; never executed: return r1.stretch < r2.stretch; | 0 | ||||||||||||||||||||||||
835 | if (r1.styleHint != r2.styleHint
never executed: r1.styleHint < r2.styleHint;return r1.styleHint < r2.styleHint; never executed: return r1.styleHint < r2.styleHint; | 0 | ||||||||||||||||||||||||
836 | if (r1.styleStrategy != r2.styleStrategy
never executed: r1.styleStrategy < r2.styleStrategy;return r1.styleStrategy < r2.styleStrategy; never executed: return r1.styleStrategy < r2.styleStrategy; | 0 | ||||||||||||||||||||||||
837 | if (r1.family != r2.family
never executed: r1.family < r2.family;return r1.family < r2.family; never executed: return r1.family < r2.family; | 0 | ||||||||||||||||||||||||
838 | if (f.d->capital != d->capital
never executed: f.d->capital < d->capital;return f.d->capital < d->capital; never executed: return f.d->capital < d->capital; | 0 | ||||||||||||||||||||||||
839 | - | |||||||||||||||||||||||||
840 | if (f.d->letterSpacingIsAbsolute != d->letterSpacingIsAbsolute
never executed: f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute; never executed: return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute; | 0 | ||||||||||||||||||||||||
841 | if (f.d->letterSpacing != d->letterSpacing
never executed: f.d->letterSpacing < d->letterSpacing;return f.d->letterSpacing < d->letterSpacing; never executed: return f.d->letterSpacing < d->letterSpacing; | 0 | ||||||||||||||||||||||||
842 | if (f.d->wordSpacing != d->wordSpacing
never executed: f.d->wordSpacing < d->wordSpacing;return f.d->wordSpacing < d->wordSpacing; never executed: return f.d->wordSpacing < d->wordSpacing; | 0 | ||||||||||||||||||||||||
843 | - | |||||||||||||||||||||||||
844 | int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning; | - | ||||||||||||||||||||||||
845 | int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning; | - | ||||||||||||||||||||||||
846 | return never executed: f1attrs < f2attrs;return f1attrs < f2attrs; never executed: return f1attrs < f2attrs; | 0 | ||||||||||||||||||||||||
847 | } | - | ||||||||||||||||||||||||
848 | bool QFont::operator!=(const QFont &f) const | - | ||||||||||||||||||||||||
849 | { | - | ||||||||||||||||||||||||
850 | return never executed: !(operator==(f));return !(operator==(f)); never executed: return !(operator==(f)); | 0 | ||||||||||||||||||||||||
851 | } | - | ||||||||||||||||||||||||
852 | - | |||||||||||||||||||||||||
853 | - | |||||||||||||||||||||||||
854 | - | |||||||||||||||||||||||||
855 | - | |||||||||||||||||||||||||
856 | QFont::operator QVariant() const | - | ||||||||||||||||||||||||
857 | { | - | ||||||||||||||||||||||||
858 | return never executed: QVariant(QVariant::Font, this);return QVariant(QVariant::Font, this); never executed: return QVariant(QVariant::Font, this); | 0 | ||||||||||||||||||||||||
859 | } | - | ||||||||||||||||||||||||
860 | bool QFont::isCopyOf(const QFont & f) const | - | ||||||||||||||||||||||||
861 | { | - | ||||||||||||||||||||||||
862 | return never executed: d == f.d;return d == f.d; never executed: return d == f.d; | 0 | ||||||||||||||||||||||||
863 | } | - | ||||||||||||||||||||||||
864 | bool QFont::rawMode() const | - | ||||||||||||||||||||||||
865 | { | - | ||||||||||||||||||||||||
866 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
867 | } | - | ||||||||||||||||||||||||
868 | - | |||||||||||||||||||||||||
869 | - | |||||||||||||||||||||||||
870 | - | |||||||||||||||||||||||||
871 | - | |||||||||||||||||||||||||
872 | - | |||||||||||||||||||||||||
873 | - | |||||||||||||||||||||||||
874 | QFont QFont::resolve(const QFont &other) const | - | ||||||||||||||||||||||||
875 | { | - | ||||||||||||||||||||||||
876 | if (resolve_mask == 0
| 0 | ||||||||||||||||||||||||
877 | QFont o(other); | - | ||||||||||||||||||||||||
878 | o.resolve_mask = resolve_mask; | - | ||||||||||||||||||||||||
879 | return never executed: o;return o; never executed: return o; | 0 | ||||||||||||||||||||||||
880 | } | - | ||||||||||||||||||||||||
881 | - | |||||||||||||||||||||||||
882 | QFont font(*this); | - | ||||||||||||||||||||||||
883 | font.detach(); | - | ||||||||||||||||||||||||
884 | font.d->resolve(resolve_mask, other.d.data()); | - | ||||||||||||||||||||||||
885 | - | |||||||||||||||||||||||||
886 | return never executed: font;return font; never executed: return font; | 0 | ||||||||||||||||||||||||
887 | } | - | ||||||||||||||||||||||||
888 | typedef QHash<QString, QStringList> QFontSubst; | - | ||||||||||||||||||||||||
889 | namespace { namespace Q_QGS_globalFontSubst { typedef QFontSubst Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QFontSubst, Q_QGS_globalFontSubst::innerFunction, Q_QGS_globalFontSubst::guard> globalFontSubst;return &holder.value; | 0 | ||||||||||||||||||||||||
890 | QString QFont::substitute(const QString &familyName) | - | ||||||||||||||||||||||||
891 | { | - | ||||||||||||||||||||||||
892 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
893 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1774) : qt_noop()); | - | ||||||||||||||||||||||||
894 | QFontSubst::ConstIterator it = fontSubst->constFind(familyName.toLower()); | - | ||||||||||||||||||||||||
895 | if (it != fontSubst->constEnd()
| 0 | ||||||||||||||||||||||||
896 | return never executed: (*it).first();return (*it).first(); never executed: return (*it).first(); | 0 | ||||||||||||||||||||||||
897 | - | |||||||||||||||||||||||||
898 | return never executed: familyName;return familyName; never executed: return familyName; | 0 | ||||||||||||||||||||||||
899 | } | - | ||||||||||||||||||||||||
900 | QStringList QFont::substitutes(const QString &familyName) | - | ||||||||||||||||||||||||
901 | { | - | ||||||||||||||||||||||||
902 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
903 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1795) : qt_noop()); | - | ||||||||||||||||||||||||
904 | return never executed: fontSubst->value(familyName.toLower(), QStringList());return fontSubst->value(familyName.toLower(), QStringList()); never executed: return fontSubst->value(familyName.toLower(), QStringList()); | 0 | ||||||||||||||||||||||||
905 | } | - | ||||||||||||||||||||||||
906 | void QFont::insertSubstitution(const QString &familyName, | - | ||||||||||||||||||||||||
907 | const QString &substituteName) | - | ||||||||||||||||||||||||
908 | { | - | ||||||||||||||||||||||||
909 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
910 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1810) : qt_noop()); | - | ||||||||||||||||||||||||
911 | QStringList &list = (*fontSubst)[familyName.toLower()]; | - | ||||||||||||||||||||||||
912 | QString s = substituteName.toLower(); | - | ||||||||||||||||||||||||
913 | if (!list.contains(s)
| 0 | ||||||||||||||||||||||||
914 | list.append(s); never executed: list.append(s); | 0 | ||||||||||||||||||||||||
915 | } never executed: end of block | 0 | ||||||||||||||||||||||||
916 | void QFont::insertSubstitutions(const QString &familyName, | - | ||||||||||||||||||||||||
917 | const QStringList &substituteNames) | - | ||||||||||||||||||||||||
918 | { | - | ||||||||||||||||||||||||
919 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
920 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1828) : qt_noop()); | - | ||||||||||||||||||||||||
921 | QStringList &list = (*fontSubst)[familyName.toLower()]; | - | ||||||||||||||||||||||||
922 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(substituteNames)>::type> _container_((substituteNames)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QString &substituteName = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||
923 | const QString lowerSubstituteName = substituteName.toLower(); | - | ||||||||||||||||||||||||
924 | if (!list.contains(lowerSubstituteName)
| 0 | ||||||||||||||||||||||||
925 | list.append(lowerSubstituteName); never executed: list.append(lowerSubstituteName); | 0 | ||||||||||||||||||||||||
926 | } never executed: end of block | 0 | ||||||||||||||||||||||||
927 | } never executed: end of block | 0 | ||||||||||||||||||||||||
928 | - | |||||||||||||||||||||||||
929 | - | |||||||||||||||||||||||||
930 | - | |||||||||||||||||||||||||
931 | - | |||||||||||||||||||||||||
932 | - | |||||||||||||||||||||||||
933 | - | |||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||
935 | void QFont::removeSubstitutions(const QString &familyName) | - | ||||||||||||||||||||||||
936 | { | - | ||||||||||||||||||||||||
937 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
938 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1846) : qt_noop()); | - | ||||||||||||||||||||||||
939 | fontSubst->remove(familyName.toLower()); | - | ||||||||||||||||||||||||
940 | } never executed: end of block | 0 | ||||||||||||||||||||||||
941 | QStringList QFont::substitutions() | - | ||||||||||||||||||||||||
942 | { | - | ||||||||||||||||||||||||
943 | QFontSubst *fontSubst = globalFontSubst(); | - | ||||||||||||||||||||||||
944 | ((!(fontSubst != 0)) ? qt_assert("fontSubst != 0",__FILE__,1866) : qt_noop()); | - | ||||||||||||||||||||||||
945 | QStringList ret = fontSubst->keys(); | - | ||||||||||||||||||||||||
946 | - | |||||||||||||||||||||||||
947 | ret.sort(); | - | ||||||||||||||||||||||||
948 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
949 | } | - | ||||||||||||||||||||||||
950 | - | |||||||||||||||||||||||||
951 | - | |||||||||||||||||||||||||
952 | - | |||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||
954 | - | |||||||||||||||||||||||||
955 | - | |||||||||||||||||||||||||
956 | static quint8 get_font_bits(int version, const QFontPrivate *f) | - | ||||||||||||||||||||||||
957 | { | - | ||||||||||||||||||||||||
958 | ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1880) : qt_noop()); | - | ||||||||||||||||||||||||
959 | quint8 bits = 0; | - | ||||||||||||||||||||||||
960 | if (f->request.style
| 0 | ||||||||||||||||||||||||
961 | bits |= 0x01; never executed: bits |= 0x01; | 0 | ||||||||||||||||||||||||
962 | if (f->underline
| 0 | ||||||||||||||||||||||||
963 | bits |= 0x02; never executed: bits |= 0x02; | 0 | ||||||||||||||||||||||||
964 | if (f->overline
| 0 | ||||||||||||||||||||||||
965 | bits |= 0x40; never executed: bits |= 0x40; | 0 | ||||||||||||||||||||||||
966 | if (f->strikeOut
| 0 | ||||||||||||||||||||||||
967 | bits |= 0x04; never executed: bits |= 0x04; | 0 | ||||||||||||||||||||||||
968 | if (f->request.fixedPitch
| 0 | ||||||||||||||||||||||||
969 | bits |= 0x08; never executed: bits |= 0x08; | 0 | ||||||||||||||||||||||||
970 | - | |||||||||||||||||||||||||
971 | - | |||||||||||||||||||||||||
972 | if (version >= QDataStream::Qt_4_0
| 0 | ||||||||||||||||||||||||
973 | if (f->kerning
| 0 | ||||||||||||||||||||||||
974 | bits |= 0x10; never executed: bits |= 0x10; | 0 | ||||||||||||||||||||||||
975 | } never executed: end of block | 0 | ||||||||||||||||||||||||
976 | if (f->request.style == QFont::StyleOblique
| 0 | ||||||||||||||||||||||||
977 | bits |= 0x80; never executed: bits |= 0x80; | 0 | ||||||||||||||||||||||||
978 | return never executed: bits;return bits; never executed: return bits; | 0 | ||||||||||||||||||||||||
979 | } | - | ||||||||||||||||||||||||
980 | - | |||||||||||||||||||||||||
981 | static quint8 get_extended_font_bits(const QFontPrivate *f) | - | ||||||||||||||||||||||||
982 | { | - | ||||||||||||||||||||||||
983 | ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1905) : qt_noop()); | - | ||||||||||||||||||||||||
984 | quint8 bits = 0; | - | ||||||||||||||||||||||||
985 | if (f->request.ignorePitch
| 0 | ||||||||||||||||||||||||
986 | bits |= 0x01; never executed: bits |= 0x01; | 0 | ||||||||||||||||||||||||
987 | if (f->letterSpacingIsAbsolute
| 0 | ||||||||||||||||||||||||
988 | bits |= 0x02; never executed: bits |= 0x02; | 0 | ||||||||||||||||||||||||
989 | return never executed: bits;return bits; never executed: return bits; | 0 | ||||||||||||||||||||||||
990 | } | - | ||||||||||||||||||||||||
991 | - | |||||||||||||||||||||||||
992 | - | |||||||||||||||||||||||||
993 | - | |||||||||||||||||||||||||
994 | - | |||||||||||||||||||||||||
995 | - | |||||||||||||||||||||||||
996 | static void set_font_bits(int version, quint8 bits, QFontPrivate *f) | - | ||||||||||||||||||||||||
997 | { | - | ||||||||||||||||||||||||
998 | ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1920) : qt_noop()); | - | ||||||||||||||||||||||||
999 | f->request.style = (
| 0 | ||||||||||||||||||||||||
1000 | f->underline = (bits & 0x02) != 0; | - | ||||||||||||||||||||||||
1001 | f->overline = (bits & 0x40) != 0; | - | ||||||||||||||||||||||||
1002 | f->strikeOut = (bits & 0x04) != 0; | - | ||||||||||||||||||||||||
1003 | f->request.fixedPitch = (bits & 0x08) != 0; | - | ||||||||||||||||||||||||
1004 | - | |||||||||||||||||||||||||
1005 | if (version >= QDataStream::Qt_4_0
| 0 | ||||||||||||||||||||||||
1006 | f->kerning = (bits & 0x10) != 0; never executed: f->kerning = (bits & 0x10) != 0; | 0 | ||||||||||||||||||||||||
1007 | if ((
| 0 | ||||||||||||||||||||||||
1008 | f->request.style = QFont::StyleOblique; never executed: f->request.style = QFont::StyleOblique; | 0 | ||||||||||||||||||||||||
1009 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1010 | - | |||||||||||||||||||||||||
1011 | static void set_extended_font_bits(quint8 bits, QFontPrivate *f) | - | ||||||||||||||||||||||||
1012 | { | - | ||||||||||||||||||||||||
1013 | ((!(f != 0)) ? qt_assert("f != 0",__FILE__,1935) : qt_noop()); | - | ||||||||||||||||||||||||
1014 | f->request.ignorePitch = (bits & 0x01) != 0; | - | ||||||||||||||||||||||||
1015 | f->letterSpacingIsAbsolute = (bits & 0x02) != 0; | - | ||||||||||||||||||||||||
1016 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1017 | QString QFont::rawName() const | - | ||||||||||||||||||||||||
1018 | { | - | ||||||||||||||||||||||||
1019 | return never executed: QLatin1String("unknown");return QLatin1String("unknown"); never executed: return QLatin1String("unknown"); | 0 | ||||||||||||||||||||||||
1020 | } | - | ||||||||||||||||||||||||
1021 | void QFont::setRawName(const QString &) | - | ||||||||||||||||||||||||
1022 | { | - | ||||||||||||||||||||||||
1023 | } | - | ||||||||||||||||||||||||
1024 | QString QFont::key() const | - | ||||||||||||||||||||||||
1025 | { | - | ||||||||||||||||||||||||
1026 | return never executed: toString();return toString(); never executed: return toString(); | 0 | ||||||||||||||||||||||||
1027 | } | - | ||||||||||||||||||||||||
1028 | QString QFont::toString() const | - | ||||||||||||||||||||||||
1029 | { | - | ||||||||||||||||||||||||
1030 | const QChar comma(QLatin1Char(',')); | - | ||||||||||||||||||||||||
1031 | return never executed: family() + comma +return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1032 | QString::number( pointSizeF()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1033 | QString::number( pixelSize()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1034 | QString::number((int) styleHint()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1035 | QString::number( weight()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1036 | QString::number((int) style()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1037 | QString::number((int) underline()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1038 | QString::number((int) strikeOut()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1039 | QString::number((int)fixedPitch()) + comma + never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1040 | QString::number((int) false); never executed: return family() + comma + QString::number( pointSizeF()) + comma + QString::number( pixelSize()) + comma + QString::number((int) styleHint()) + comma + QString::number( weight()) + comma + QString::number((int) style()) + comma + QString::number((int) underline()) + comma + QString::number((int) strikeOut()) + comma + QString::number((int)fixedPitch()) + comma + QString::number((int) false); | 0 | ||||||||||||||||||||||||
1041 | } | - | ||||||||||||||||||||||||
1042 | uint qHash(const QFont &font, uint seed) noexcept | - | ||||||||||||||||||||||||
1043 | { | - | ||||||||||||||||||||||||
1044 | return never executed: qHash(QFontPrivate::get(font)->request, seed);return qHash(QFontPrivate::get(font)->request, seed); never executed: return qHash(QFontPrivate::get(font)->request, seed); | 0 | ||||||||||||||||||||||||
1045 | } | - | ||||||||||||||||||||||||
1046 | bool QFont::fromString(const QString &descrip) | - | ||||||||||||||||||||||||
1047 | { | - | ||||||||||||||||||||||||
1048 | QStringList l(descrip.split(QLatin1Char(','))); | - | ||||||||||||||||||||||||
1049 | - | |||||||||||||||||||||||||
1050 | int count = l.count(); | - | ||||||||||||||||||||||||
1051 | if (!count
| 0 | ||||||||||||||||||||||||
1052 | QMessageLogger(__FILE__, 2039, __PRETTY_FUNCTION__).warning("QFont::fromString: Invalid description '%s'", | - | ||||||||||||||||||||||||
1053 | descrip.isEmpty() ? "(empty)" : descrip.toLatin1().data()); | - | ||||||||||||||||||||||||
1054 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1055 | } | - | ||||||||||||||||||||||||
1056 | - | |||||||||||||||||||||||||
1057 | setFamily(l[0]); | - | ||||||||||||||||||||||||
1058 | if (count > 1
| 0 | ||||||||||||||||||||||||
1059 | setPointSizeF(l[1].toDouble()); never executed: setPointSizeF(l[1].toDouble()); | 0 | ||||||||||||||||||||||||
1060 | if (count == 9
| 0 | ||||||||||||||||||||||||
1061 | setStyleHint((StyleHint) l[2].toInt()); | - | ||||||||||||||||||||||||
1062 | setWeight(qMax(qMin(99, l[3].toInt()), 0)); | - | ||||||||||||||||||||||||
1063 | setItalic(l[4].toInt()); | - | ||||||||||||||||||||||||
1064 | setUnderline(l[5].toInt()); | - | ||||||||||||||||||||||||
1065 | setStrikeOut(l[6].toInt()); | - | ||||||||||||||||||||||||
1066 | setFixedPitch(l[7].toInt()); | - | ||||||||||||||||||||||||
1067 | } never executed: else if (count == 10end of block
| 0 | ||||||||||||||||||||||||
1068 | if (l[2].toInt() > 0
| 0 | ||||||||||||||||||||||||
1069 | setPixelSize(l[2].toInt()); never executed: setPixelSize(l[2].toInt()); | 0 | ||||||||||||||||||||||||
1070 | setStyleHint((StyleHint) l[3].toInt()); | - | ||||||||||||||||||||||||
1071 | setWeight(qMax(qMin(99, l[4].toInt()), 0)); | - | ||||||||||||||||||||||||
1072 | setStyle((QFont::Style)l[5].toInt()); | - | ||||||||||||||||||||||||
1073 | setUnderline(l[6].toInt()); | - | ||||||||||||||||||||||||
1074 | setStrikeOut(l[7].toInt()); | - | ||||||||||||||||||||||||
1075 | setFixedPitch(l[8].toInt()); | - | ||||||||||||||||||||||||
1076 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1077 | if (count >= 9
| 0 | ||||||||||||||||||||||||
1078 | d->request.ignorePitch = true; never executed: d->request.ignorePitch = true; | 0 | ||||||||||||||||||||||||
1079 | - | |||||||||||||||||||||||||
1080 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1081 | } | - | ||||||||||||||||||||||||
1082 | void QFont::initialize() | - | ||||||||||||||||||||||||
1083 | { | - | ||||||||||||||||||||||||
1084 | } | - | ||||||||||||||||||||||||
1085 | - | |||||||||||||||||||||||||
1086 | - | |||||||||||||||||||||||||
1087 | - | |||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||
1090 | - | |||||||||||||||||||||||||
1091 | void QFont::cleanup() | - | ||||||||||||||||||||||||
1092 | { | - | ||||||||||||||||||||||||
1093 | QFontCache::cleanup(); | - | ||||||||||||||||||||||||
1094 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1095 | - | |||||||||||||||||||||||||
1096 | - | |||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||
1098 | - | |||||||||||||||||||||||||
1099 | - | |||||||||||||||||||||||||
1100 | void QFont::cacheStatistics() | - | ||||||||||||||||||||||||
1101 | { | - | ||||||||||||||||||||||||
1102 | } | - | ||||||||||||||||||||||||
1103 | QString QFont::lastResortFamily() const | - | ||||||||||||||||||||||||
1104 | { | - | ||||||||||||||||||||||||
1105 | return never executed: QString::fromLatin1("helvetica");return QString::fromLatin1("helvetica"); never executed: return QString::fromLatin1("helvetica"); | 0 | ||||||||||||||||||||||||
1106 | } | - | ||||||||||||||||||||||||
1107 | - | |||||||||||||||||||||||||
1108 | extern QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, | - | ||||||||||||||||||||||||
1109 | QFont::StyleHint styleHint, QChar::Script script); | - | ||||||||||||||||||||||||
1110 | QString QFont::defaultFamily() const | - | ||||||||||||||||||||||||
1111 | { | - | ||||||||||||||||||||||||
1112 | const QStringList fallbacks = qt_fallbacksForFamily(QString(), QFont::StyleNormal | - | ||||||||||||||||||||||||
1113 | , QFont::StyleHint(d->request.styleHint), QChar::Script_Common); | - | ||||||||||||||||||||||||
1114 | if (!fallbacks.isEmpty()
| 0 | ||||||||||||||||||||||||
1115 | return never executed: fallbacks.first();return fallbacks.first(); never executed: return fallbacks.first(); | 0 | ||||||||||||||||||||||||
1116 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
1117 | } | - | ||||||||||||||||||||||||
1118 | QString QFont::lastResortFont() const | - | ||||||||||||||||||||||||
1119 | { | - | ||||||||||||||||||||||||
1120 | QMessageLogger(__FILE__, 2158, __PRETTY_FUNCTION__).fatal("QFont::lastResortFont: Cannot find any reasonable font"); | - | ||||||||||||||||||||||||
1121 | - | |||||||||||||||||||||||||
1122 | return never executed: QString();return QString(); never executed: return QString(); | 0 | ||||||||||||||||||||||||
1123 | } | - | ||||||||||||||||||||||||
1124 | QDataStream &operator<<(QDataStream &s, const QFont &font) | - | ||||||||||||||||||||||||
1125 | { | - | ||||||||||||||||||||||||
1126 | if (s.version() == 1
| 0 | ||||||||||||||||||||||||
1127 | s << font.d->request.family.toLatin1(); | - | ||||||||||||||||||||||||
1128 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1129 | s << font.d->request.family; | - | ||||||||||||||||||||||||
1130 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1131 | s << font.d->request.styleName; never executed: s << font.d->request.styleName; | 0 | ||||||||||||||||||||||||
1132 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1133 | - | |||||||||||||||||||||||||
1134 | if (s.version() >= QDataStream::Qt_4_0
| 0 | ||||||||||||||||||||||||
1135 | - | |||||||||||||||||||||||||
1136 | double pointSize = font.d->request.pointSize; | - | ||||||||||||||||||||||||
1137 | qint32 pixelSize = font.d->request.pixelSize; | - | ||||||||||||||||||||||||
1138 | s << pointSize; | - | ||||||||||||||||||||||||
1139 | s << pixelSize; | - | ||||||||||||||||||||||||
1140 | } never executed: else if (s.version() <= 3end of block
| 0 | ||||||||||||||||||||||||
1141 | qint16 pointSize = (qint16) (font.d->request.pointSize * 10); | - | ||||||||||||||||||||||||
1142 | if (pointSize < 0
| 0 | ||||||||||||||||||||||||
1143 | pointSize = (qint16)QFontInfo(font).pointSize() * 10; | - | ||||||||||||||||||||||||
1144 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1145 | s << pointSize; | - | ||||||||||||||||||||||||
1146 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1147 | s << (qint16) (font.d->request.pointSize * 10); | - | ||||||||||||||||||||||||
1148 | s << (qint16) font.d->request.pixelSize; | - | ||||||||||||||||||||||||
1149 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1150 | - | |||||||||||||||||||||||||
1151 | s << (quint8) font.d->request.styleHint; | - | ||||||||||||||||||||||||
1152 | if (s.version() >= QDataStream::Qt_3_1
| 0 | ||||||||||||||||||||||||
1153 | - | |||||||||||||||||||||||||
1154 | - | |||||||||||||||||||||||||
1155 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1156 | s << (quint16) font.d->request.styleStrategy; never executed: s << (quint16) font.d->request.styleStrategy; | 0 | ||||||||||||||||||||||||
1157 | else | - | ||||||||||||||||||||||||
1158 | s << (quint8) font.d->request.styleStrategy; never executed: s << (quint8) font.d->request.styleStrategy; | 0 | ||||||||||||||||||||||||
1159 | } | - | ||||||||||||||||||||||||
1160 | s << (quint8) 0 | - | ||||||||||||||||||||||||
1161 | << (quint8) font.d->request.weight | - | ||||||||||||||||||||||||
1162 | << get_font_bits(s.version(), font.d.data()); | - | ||||||||||||||||||||||||
1163 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||||||||
1164 | s << (quint16)font.d->request.stretch; never executed: s << (quint16)font.d->request.stretch; | 0 | ||||||||||||||||||||||||
1165 | if (s.version() >= QDataStream::Qt_4_4
| 0 | ||||||||||||||||||||||||
1166 | s << get_extended_font_bits(font.d.data()); never executed: s << get_extended_font_bits(font.d.data()); | 0 | ||||||||||||||||||||||||
1167 | if (s.version() >= QDataStream::Qt_4_5
| 0 | ||||||||||||||||||||||||
1168 | s << font.d->letterSpacing.value(); | - | ||||||||||||||||||||||||
1169 | s << font.d->wordSpacing.value(); | - | ||||||||||||||||||||||||
1170 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1171 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1172 | s << (quint8)font.d->request.hintingPreference; never executed: s << (quint8)font.d->request.hintingPreference; | 0 | ||||||||||||||||||||||||
1173 | if (s.version() >= QDataStream::Qt_5_6
| 0 | ||||||||||||||||||||||||
1174 | s << (quint8)font.d->capital; never executed: s << (quint8)font.d->capital; | 0 | ||||||||||||||||||||||||
1175 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||
1176 | } | - | ||||||||||||||||||||||||
1177 | QDataStream &operator>>(QDataStream &s, QFont &font) | - | ||||||||||||||||||||||||
1178 | { | - | ||||||||||||||||||||||||
1179 | font.d = new QFontPrivate; | - | ||||||||||||||||||||||||
1180 | font.resolve_mask = QFont::AllPropertiesResolved; | - | ||||||||||||||||||||||||
1181 | - | |||||||||||||||||||||||||
1182 | quint8 styleHint, charSet, weight, bits; | - | ||||||||||||||||||||||||
1183 | quint16 styleStrategy = QFont::PreferDefault; | - | ||||||||||||||||||||||||
1184 | - | |||||||||||||||||||||||||
1185 | if (s.version() == 1
| 0 | ||||||||||||||||||||||||
1186 | QByteArray fam; | - | ||||||||||||||||||||||||
1187 | s >> fam; | - | ||||||||||||||||||||||||
1188 | font.d->request.family = QString::fromLatin1(fam); | - | ||||||||||||||||||||||||
1189 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1190 | s >> font.d->request.family; | - | ||||||||||||||||||||||||
1191 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1192 | s >> font.d->request.styleName; never executed: s >> font.d->request.styleName; | 0 | ||||||||||||||||||||||||
1193 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1194 | - | |||||||||||||||||||||||||
1195 | if (s.version() >= QDataStream::Qt_4_0
| 0 | ||||||||||||||||||||||||
1196 | - | |||||||||||||||||||||||||
1197 | double pointSize; | - | ||||||||||||||||||||||||
1198 | qint32 pixelSize; | - | ||||||||||||||||||||||||
1199 | s >> pointSize; | - | ||||||||||||||||||||||||
1200 | s >> pixelSize; | - | ||||||||||||||||||||||||
1201 | font.d->request.pointSize = qreal(pointSize); | - | ||||||||||||||||||||||||
1202 | font.d->request.pixelSize = pixelSize; | - | ||||||||||||||||||||||||
1203 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1204 | qint16 pointSize, pixelSize = -1; | - | ||||||||||||||||||||||||
1205 | s >> pointSize; | - | ||||||||||||||||||||||||
1206 | if (s.version() >= 4
| 0 | ||||||||||||||||||||||||
1207 | s >> pixelSize; never executed: s >> pixelSize; | 0 | ||||||||||||||||||||||||
1208 | font.d->request.pointSize = qreal(pointSize / 10.); | - | ||||||||||||||||||||||||
1209 | font.d->request.pixelSize = pixelSize; | - | ||||||||||||||||||||||||
1210 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1211 | s >> styleHint; | - | ||||||||||||||||||||||||
1212 | if (s.version() >= QDataStream::Qt_3_1
| 0 | ||||||||||||||||||||||||
1213 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1214 | s >> styleStrategy; | - | ||||||||||||||||||||||||
1215 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1216 | quint8 tempStyleStrategy; | - | ||||||||||||||||||||||||
1217 | s >> tempStyleStrategy; | - | ||||||||||||||||||||||||
1218 | styleStrategy = tempStyleStrategy; | - | ||||||||||||||||||||||||
1219 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1220 | } | - | ||||||||||||||||||||||||
1221 | - | |||||||||||||||||||||||||
1222 | s >> charSet; | - | ||||||||||||||||||||||||
1223 | s >> weight; | - | ||||||||||||||||||||||||
1224 | s >> bits; | - | ||||||||||||||||||||||||
1225 | - | |||||||||||||||||||||||||
1226 | font.d->request.styleHint = styleHint; | - | ||||||||||||||||||||||||
1227 | font.d->request.styleStrategy = styleStrategy; | - | ||||||||||||||||||||||||
1228 | font.d->request.weight = weight; | - | ||||||||||||||||||||||||
1229 | - | |||||||||||||||||||||||||
1230 | set_font_bits(s.version(), bits, font.d.data()); | - | ||||||||||||||||||||||||
1231 | - | |||||||||||||||||||||||||
1232 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||||||||
1233 | quint16 stretch; | - | ||||||||||||||||||||||||
1234 | s >> stretch; | - | ||||||||||||||||||||||||
1235 | font.d->request.stretch = stretch; | - | ||||||||||||||||||||||||
1236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1237 | - | |||||||||||||||||||||||||
1238 | if (s.version() >= QDataStream::Qt_4_4
| 0 | ||||||||||||||||||||||||
1239 | quint8 extendedBits; | - | ||||||||||||||||||||||||
1240 | s >> extendedBits; | - | ||||||||||||||||||||||||
1241 | set_extended_font_bits(extendedBits, font.d.data()); | - | ||||||||||||||||||||||||
1242 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1243 | if (s.version() >= QDataStream::Qt_4_5
| 0 | ||||||||||||||||||||||||
1244 | int value; | - | ||||||||||||||||||||||||
1245 | s >> value; | - | ||||||||||||||||||||||||
1246 | font.d->letterSpacing.setValue(value); | - | ||||||||||||||||||||||||
1247 | s >> value; | - | ||||||||||||||||||||||||
1248 | font.d->wordSpacing.setValue(value); | - | ||||||||||||||||||||||||
1249 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1250 | if (s.version() >= QDataStream::Qt_5_4
| 0 | ||||||||||||||||||||||||
1251 | quint8 value; | - | ||||||||||||||||||||||||
1252 | s >> value; | - | ||||||||||||||||||||||||
1253 | font.d->request.hintingPreference = QFont::HintingPreference(value); | - | ||||||||||||||||||||||||
1254 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1255 | if (s.version() >= QDataStream::Qt_5_6
| 0 | ||||||||||||||||||||||||
1256 | quint8 value; | - | ||||||||||||||||||||||||
1257 | s >> value; | - | ||||||||||||||||||||||||
1258 | font.d->capital = QFont::Capitalization(value); | - | ||||||||||||||||||||||||
1259 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1260 | return never executed: s;return s; never executed: return s; | 0 | ||||||||||||||||||||||||
1261 | } | - | ||||||||||||||||||||||||
1262 | QFontInfo::QFontInfo(const QFont &font) | - | ||||||||||||||||||||||||
1263 | : d(font.d.data()) | - | ||||||||||||||||||||||||
1264 | { | - | ||||||||||||||||||||||||
1265 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1266 | - | |||||||||||||||||||||||||
1267 | - | |||||||||||||||||||||||||
1268 | - | |||||||||||||||||||||||||
1269 | - | |||||||||||||||||||||||||
1270 | QFontInfo::QFontInfo(const QFontInfo &fi) | - | ||||||||||||||||||||||||
1271 | : d(fi.d.data()) | - | ||||||||||||||||||||||||
1272 | { | - | ||||||||||||||||||||||||
1273 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1274 | - | |||||||||||||||||||||||||
1275 | - | |||||||||||||||||||||||||
1276 | - | |||||||||||||||||||||||||
1277 | - | |||||||||||||||||||||||||
1278 | QFontInfo::~QFontInfo() | - | ||||||||||||||||||||||||
1279 | { | - | ||||||||||||||||||||||||
1280 | } | - | ||||||||||||||||||||||||
1281 | - | |||||||||||||||||||||||||
1282 | - | |||||||||||||||||||||||||
1283 | - | |||||||||||||||||||||||||
1284 | - | |||||||||||||||||||||||||
1285 | QFontInfo &QFontInfo::operator=(const QFontInfo &fi) | - | ||||||||||||||||||||||||
1286 | { | - | ||||||||||||||||||||||||
1287 | d = fi.d.data(); | - | ||||||||||||||||||||||||
1288 | return never executed: *this;return *this; never executed: return *this; | 0 | ||||||||||||||||||||||||
1289 | } | - | ||||||||||||||||||||||||
1290 | QString QFontInfo::family() const | - | ||||||||||||||||||||||||
1291 | { | - | ||||||||||||||||||||||||
1292 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1293 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2437) : qt_noop()); | - | ||||||||||||||||||||||||
1294 | return never executed: engine->fontDef.family;return engine->fontDef.family; never executed: return engine->fontDef.family; | 0 | ||||||||||||||||||||||||
1295 | } | - | ||||||||||||||||||||||||
1296 | QString QFontInfo::styleName() const | - | ||||||||||||||||||||||||
1297 | { | - | ||||||||||||||||||||||||
1298 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1299 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2452) : qt_noop()); | - | ||||||||||||||||||||||||
1300 | return never executed: engine->fontDef.styleName;return engine->fontDef.styleName; never executed: return engine->fontDef.styleName; | 0 | ||||||||||||||||||||||||
1301 | } | - | ||||||||||||||||||||||||
1302 | - | |||||||||||||||||||||||||
1303 | - | |||||||||||||||||||||||||
1304 | - | |||||||||||||||||||||||||
1305 | - | |||||||||||||||||||||||||
1306 | - | |||||||||||||||||||||||||
1307 | - | |||||||||||||||||||||||||
1308 | int QFontInfo::pointSize() const | - | ||||||||||||||||||||||||
1309 | { | - | ||||||||||||||||||||||||
1310 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1311 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2464) : qt_noop()); | - | ||||||||||||||||||||||||
1312 | return never executed: qRound(engine->fontDef.pointSize);return qRound(engine->fontDef.pointSize); never executed: return qRound(engine->fontDef.pointSize); | 0 | ||||||||||||||||||||||||
1313 | } | - | ||||||||||||||||||||||||
1314 | - | |||||||||||||||||||||||||
1315 | - | |||||||||||||||||||||||||
1316 | - | |||||||||||||||||||||||||
1317 | - | |||||||||||||||||||||||||
1318 | - | |||||||||||||||||||||||||
1319 | - | |||||||||||||||||||||||||
1320 | qreal QFontInfo::pointSizeF() const | - | ||||||||||||||||||||||||
1321 | { | - | ||||||||||||||||||||||||
1322 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1323 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2476) : qt_noop()); | - | ||||||||||||||||||||||||
1324 | return never executed: engine->fontDef.pointSize;return engine->fontDef.pointSize; never executed: return engine->fontDef.pointSize; | 0 | ||||||||||||||||||||||||
1325 | } | - | ||||||||||||||||||||||||
1326 | - | |||||||||||||||||||||||||
1327 | - | |||||||||||||||||||||||||
1328 | - | |||||||||||||||||||||||||
1329 | - | |||||||||||||||||||||||||
1330 | - | |||||||||||||||||||||||||
1331 | - | |||||||||||||||||||||||||
1332 | int QFontInfo::pixelSize() const | - | ||||||||||||||||||||||||
1333 | { | - | ||||||||||||||||||||||||
1334 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1335 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2488) : qt_noop()); | - | ||||||||||||||||||||||||
1336 | return never executed: engine->fontDef.pixelSize;return engine->fontDef.pixelSize; never executed: return engine->fontDef.pixelSize; | 0 | ||||||||||||||||||||||||
1337 | } | - | ||||||||||||||||||||||||
1338 | - | |||||||||||||||||||||||||
1339 | - | |||||||||||||||||||||||||
1340 | - | |||||||||||||||||||||||||
1341 | - | |||||||||||||||||||||||||
1342 | - | |||||||||||||||||||||||||
1343 | - | |||||||||||||||||||||||||
1344 | bool QFontInfo::italic() const | - | ||||||||||||||||||||||||
1345 | { | - | ||||||||||||||||||||||||
1346 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1347 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2500) : qt_noop()); | - | ||||||||||||||||||||||||
1348 | return never executed: engine->fontDef.style != QFont::StyleNormal;return engine->fontDef.style != QFont::StyleNormal; never executed: return engine->fontDef.style != QFont::StyleNormal; | 0 | ||||||||||||||||||||||||
1349 | } | - | ||||||||||||||||||||||||
1350 | - | |||||||||||||||||||||||||
1351 | - | |||||||||||||||||||||||||
1352 | - | |||||||||||||||||||||||||
1353 | - | |||||||||||||||||||||||||
1354 | - | |||||||||||||||||||||||||
1355 | - | |||||||||||||||||||||||||
1356 | QFont::Style QFontInfo::style() const | - | ||||||||||||||||||||||||
1357 | { | - | ||||||||||||||||||||||||
1358 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1359 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2512) : qt_noop()); | - | ||||||||||||||||||||||||
1360 | return never executed: (QFont::Style)engine->fontDef.style;return (QFont::Style)engine->fontDef.style; never executed: return (QFont::Style)engine->fontDef.style; | 0 | ||||||||||||||||||||||||
1361 | } | - | ||||||||||||||||||||||||
1362 | - | |||||||||||||||||||||||||
1363 | - | |||||||||||||||||||||||||
1364 | - | |||||||||||||||||||||||||
1365 | - | |||||||||||||||||||||||||
1366 | - | |||||||||||||||||||||||||
1367 | - | |||||||||||||||||||||||||
1368 | int QFontInfo::weight() const | - | ||||||||||||||||||||||||
1369 | { | - | ||||||||||||||||||||||||
1370 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1371 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2524) : qt_noop()); | - | ||||||||||||||||||||||||
1372 | return never executed: engine->fontDef.weight;return engine->fontDef.weight; never executed: return engine->fontDef.weight; | 0 | ||||||||||||||||||||||||
1373 | - | |||||||||||||||||||||||||
1374 | } | - | ||||||||||||||||||||||||
1375 | bool QFontInfo::underline() const | - | ||||||||||||||||||||||||
1376 | { | - | ||||||||||||||||||||||||
1377 | return never executed: d->underline;return d->underline; never executed: return d->underline; | 0 | ||||||||||||||||||||||||
1378 | } | - | ||||||||||||||||||||||||
1379 | bool QFontInfo::overline() const | - | ||||||||||||||||||||||||
1380 | { | - | ||||||||||||||||||||||||
1381 | return never executed: d->overline;return d->overline; never executed: return d->overline; | 0 | ||||||||||||||||||||||||
1382 | } | - | ||||||||||||||||||||||||
1383 | bool QFontInfo::strikeOut() const | - | ||||||||||||||||||||||||
1384 | { | - | ||||||||||||||||||||||||
1385 | return never executed: d->strikeOut;return d->strikeOut; never executed: return d->strikeOut; | 0 | ||||||||||||||||||||||||
1386 | } | - | ||||||||||||||||||||||||
1387 | - | |||||||||||||||||||||||||
1388 | - | |||||||||||||||||||||||||
1389 | - | |||||||||||||||||||||||||
1390 | - | |||||||||||||||||||||||||
1391 | - | |||||||||||||||||||||||||
1392 | - | |||||||||||||||||||||||||
1393 | bool QFontInfo::fixedPitch() const | - | ||||||||||||||||||||||||
1394 | { | - | ||||||||||||||||||||||||
1395 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1396 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2589) : qt_noop()); | - | ||||||||||||||||||||||||
1397 | return never executed: engine->fontDef.fixedPitch;return engine->fontDef.fixedPitch; never executed: return engine->fontDef.fixedPitch; | 0 | ||||||||||||||||||||||||
1398 | } | - | ||||||||||||||||||||||||
1399 | QFont::StyleHint QFontInfo::styleHint() const | - | ||||||||||||||||||||||||
1400 | { | - | ||||||||||||||||||||||||
1401 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1402 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2615) : qt_noop()); | - | ||||||||||||||||||||||||
1403 | return never executed: (QFont::StyleHint) engine->fontDef.styleHint;return (QFont::StyleHint) engine->fontDef.styleHint; never executed: return (QFont::StyleHint) engine->fontDef.styleHint; | 0 | ||||||||||||||||||||||||
1404 | } | - | ||||||||||||||||||||||||
1405 | bool QFontInfo::rawMode() const | - | ||||||||||||||||||||||||
1406 | { | - | ||||||||||||||||||||||||
1407 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1408 | } | - | ||||||||||||||||||||||||
1409 | bool QFontInfo::exactMatch() const | - | ||||||||||||||||||||||||
1410 | { | - | ||||||||||||||||||||||||
1411 | QFontEngine *engine = d->engineForScript(QChar::Script_Common); | - | ||||||||||||||||||||||||
1412 | ((!(engine != 0)) ? qt_assert("engine != 0",__FILE__,2647) : qt_noop()); | - | ||||||||||||||||||||||||
1413 | return never executed: d->request.exactMatch(engine->fontDef);return d->request.exactMatch(engine->fontDef); never executed: return d->request.exactMatch(engine->fontDef); | 0 | ||||||||||||||||||||||||
1414 | } | - | ||||||||||||||||||||||||
1415 | static const int fast_timeout = 10000; | - | ||||||||||||||||||||||||
1416 | static const int slow_timeout = 300000; | - | ||||||||||||||||||||||||
1417 | - | |||||||||||||||||||||||||
1418 | - | |||||||||||||||||||||||||
1419 | const uint QFontCache::min_cost = 4*1024; | - | ||||||||||||||||||||||||
1420 | namespace { namespace Q_QGS_theFontCache { typedef QThreadStorage<QFontCache *> Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed); never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block never executed: &holder.value;return &holder.value; never executed: } } } static QGlobalStatic<QThreadStorage<QFontCache *>, Q_QGS_theFontCache::innerFunction, Q_QGS_theFontCache::guard> theFontCache;return &holder.value; | 0 | ||||||||||||||||||||||||
1421 | - | |||||||||||||||||||||||||
1422 | QFontCache *QFontCache::instance() | - | ||||||||||||||||||||||||
1423 | { | - | ||||||||||||||||||||||||
1424 | QFontCache *&fontCache = theFontCache()->localData(); | - | ||||||||||||||||||||||||
1425 | if (!fontCache
| 0 | ||||||||||||||||||||||||
1426 | fontCache = new QFontCache; never executed: fontCache = new QFontCache; | 0 | ||||||||||||||||||||||||
1427 | return never executed: fontCache;return fontCache; never executed: return fontCache; | 0 | ||||||||||||||||||||||||
1428 | } | - | ||||||||||||||||||||||||
1429 | - | |||||||||||||||||||||||||
1430 | void QFontCache::cleanup() | - | ||||||||||||||||||||||||
1431 | { | - | ||||||||||||||||||||||||
1432 | QThreadStorage<QFontCache *> *cache = 0; | - | ||||||||||||||||||||||||
1433 | if (true) { | - | ||||||||||||||||||||||||
1434 | cache = theFontCache(); | - | ||||||||||||||||||||||||
1435 | } never executed: else {end of block dead code: { } | - | ||||||||||||||||||||||||
1436 | - | |||||||||||||||||||||||||
1437 | } dead code: { } | - | ||||||||||||||||||||||||
1438 | if (cache
| 0 | ||||||||||||||||||||||||
1439 | cache->setLocalData(0); never executed: cache->setLocalData(0); | 0 | ||||||||||||||||||||||||
1440 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1441 | - | |||||||||||||||||||||||||
1442 | - | |||||||||||||||||||||||||
1443 | QBasicAtomicInt font_cache_id = { 1 }; | - | ||||||||||||||||||||||||
1444 | - | |||||||||||||||||||||||||
1445 | QFontCache::QFontCache() | - | ||||||||||||||||||||||||
1446 | : QObject(), total_cost(0), max_cost(min_cost), | - | ||||||||||||||||||||||||
1447 | current_timestamp(0), fast(false), timer_id(-1), | - | ||||||||||||||||||||||||
1448 | m_id(font_cache_id.fetchAndAddRelaxed(1)) | - | ||||||||||||||||||||||||
1449 | { | - | ||||||||||||||||||||||||
1450 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1451 | - | |||||||||||||||||||||||||
1452 | QFontCache::~QFontCache() | - | ||||||||||||||||||||||||
1453 | { | - | ||||||||||||||||||||||||
1454 | clear(); | - | ||||||||||||||||||||||||
1455 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1456 | - | |||||||||||||||||||||||||
1457 | void QFontCache::clear() | - | ||||||||||||||||||||||||
1458 | { | - | ||||||||||||||||||||||||
1459 | { | - | ||||||||||||||||||||||||
1460 | EngineDataCache::Iterator it = engineDataCache.begin(), | - | ||||||||||||||||||||||||
1461 | end = engineDataCache.end(); | - | ||||||||||||||||||||||||
1462 | while (it != end
| 0 | ||||||||||||||||||||||||
1463 | QFontEngineData *data = it.value(); | - | ||||||||||||||||||||||||
1464 | for (int i = 0; i < QChar::ScriptCount
| 0 | ||||||||||||||||||||||||
1465 | if (data->engines[i]
| 0 | ||||||||||||||||||||||||
1466 | if (!data->engines[i]->ref.deref()
| 0 | ||||||||||||||||||||||||
1467 | ((!(engineCacheCount.value(data->engines[i]) == 0)) ? qt_assert("engineCacheCount.value(data->engines[i]) == 0",__FILE__,2728) : qt_noop()); | - | ||||||||||||||||||||||||
1468 | delete data->engines[i]; | - | ||||||||||||||||||||||||
1469 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1470 | data->engines[i] = 0; | - | ||||||||||||||||||||||||
1471 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1472 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1473 | if (!data->ref.deref()
| 0 | ||||||||||||||||||||||||
1474 | delete data; | - | ||||||||||||||||||||||||
1475 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1476 | if (false) QMessageLogger(__FILE__, 2737, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d", dead code: QMessageLogger(__FILE__, 2737, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d", data, data->ref.load()); | - | ||||||||||||||||||||||||
1477 | data, data->ref.load()); dead code: QMessageLogger(__FILE__, 2737, __PRETTY_FUNCTION__).debug("QFontCache::clear: engineData %p still has refcount %d", data, data->ref.load()); | - | ||||||||||||||||||||||||
1478 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1479 | ++it; | - | ||||||||||||||||||||||||
1480 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1481 | } | - | ||||||||||||||||||||||||
1482 | - | |||||||||||||||||||||||||
1483 | engineDataCache.clear(); | - | ||||||||||||||||||||||||
1484 | - | |||||||||||||||||||||||||
1485 | - | |||||||||||||||||||||||||
1486 | bool mightHaveEnginesLeftForCleanup; | - | ||||||||||||||||||||||||
1487 | do { | - | ||||||||||||||||||||||||
1488 | mightHaveEnginesLeftForCleanup = false; | - | ||||||||||||||||||||||||
1489 | for (EngineCache::Iterator it = engineCache.begin(), end = engineCache.end(); | - | ||||||||||||||||||||||||
1490 | it != end
| 0 | ||||||||||||||||||||||||
1491 | QFontEngine *engine = it.value().data; | - | ||||||||||||||||||||||||
1492 | if (engine
| 0 | ||||||||||||||||||||||||
1493 | const int cacheCount = --engineCacheCount[engine]; | - | ||||||||||||||||||||||||
1494 | ((!(cacheCount >= 0)) ? qt_assert("cacheCount >= 0",__FILE__,2755) : qt_noop()); | - | ||||||||||||||||||||||||
1495 | if (!engine->ref.deref()
| 0 | ||||||||||||||||||||||||
1496 | ((!(cacheCount == 0)) ? qt_assert("cacheCount == 0",__FILE__,2757) : qt_noop()); | - | ||||||||||||||||||||||||
1497 | mightHaveEnginesLeftForCleanup = engine->type() == QFontEngine::Multi; | - | ||||||||||||||||||||||||
1498 | delete engine; | - | ||||||||||||||||||||||||
1499 | } never executed: else if (cacheCount == 0end of block
| 0 | ||||||||||||||||||||||||
1500 | if (false) QMessageLogger(__FILE__, 2761, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d", dead code: QMessageLogger(__FILE__, 2761, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d", engine, engine->ref.load()); | - | ||||||||||||||||||||||||
1501 | engine, engine->ref.load()); dead code: QMessageLogger(__FILE__, 2761, __PRETTY_FUNCTION__).debug("QFontCache::clear: engine %p still has refcount %d", engine, engine->ref.load()); | - | ||||||||||||||||||||||||
1502 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1503 | it.value().data = 0; | - | ||||||||||||||||||||||||
1504 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1505 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1506 | } never executed: while (mightHaveEnginesLeftForCleanupend of block
| 0 | ||||||||||||||||||||||||
1507 | - | |||||||||||||||||||||||||
1508 | engineCache.clear(); | - | ||||||||||||||||||||||||
1509 | engineCacheCount.clear(); | - | ||||||||||||||||||||||||
1510 | - | |||||||||||||||||||||||||
1511 | - | |||||||||||||||||||||||||
1512 | total_cost = 0; | - | ||||||||||||||||||||||||
1513 | max_cost = min_cost; | - | ||||||||||||||||||||||||
1514 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1515 | - | |||||||||||||||||||||||||
1516 | - | |||||||||||||||||||||||||
1517 | QFontEngineData *QFontCache::findEngineData(const QFontDef &def) const | - | ||||||||||||||||||||||||
1518 | { | - | ||||||||||||||||||||||||
1519 | EngineDataCache::ConstIterator it = engineDataCache.constFind(def); | - | ||||||||||||||||||||||||
1520 | if (it == engineDataCache.constEnd()
| 0 | ||||||||||||||||||||||||
1521 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1522 | - | |||||||||||||||||||||||||
1523 | - | |||||||||||||||||||||||||
1524 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
1525 | } | - | ||||||||||||||||||||||||
1526 | - | |||||||||||||||||||||||||
1527 | void QFontCache::insertEngineData(const QFontDef &def, QFontEngineData *engineData) | - | ||||||||||||||||||||||||
1528 | { | - | ||||||||||||||||||||||||
1529 | ((!(!engineDataCache.contains(def))) ? qt_assert("!engineDataCache.contains(def)",__FILE__,2798) : qt_noop()); | - | ||||||||||||||||||||||||
1530 | - | |||||||||||||||||||||||||
1531 | engineData->ref.ref(); | - | ||||||||||||||||||||||||
1532 | - | |||||||||||||||||||||||||
1533 | if (total_cost > min_cost * 2
| 0 | ||||||||||||||||||||||||
1534 | decreaseCache(); never executed: decreaseCache(); | 0 | ||||||||||||||||||||||||
1535 | - | |||||||||||||||||||||||||
1536 | engineDataCache.insert(def, engineData); | - | ||||||||||||||||||||||||
1537 | increaseCost(sizeof(QFontEngineData)); | - | ||||||||||||||||||||||||
1538 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1539 | - | |||||||||||||||||||||||||
1540 | QFontEngine *QFontCache::findEngine(const Key &key) | - | ||||||||||||||||||||||||
1541 | { | - | ||||||||||||||||||||||||
1542 | EngineCache::Iterator it = engineCache.find(key), | - | ||||||||||||||||||||||||
1543 | end = engineCache.end(); | - | ||||||||||||||||||||||||
1544 | if (it == end
never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
1545 | - | |||||||||||||||||||||||||
1546 | ((!(it.value().data != nullptr)) ? qt_assert("it.value().data != Q_NULLPTR",__FILE__,2815) : qt_noop()); | - | ||||||||||||||||||||||||
1547 | ((!(key.multi == (it.value().data->type() == QFontEngine::Multi))) ? qt_assert("key.multi == (it.value().data->type() == QFontEngine::Multi)",__FILE__,2816) : qt_noop()); | - | ||||||||||||||||||||||||
1548 | - | |||||||||||||||||||||||||
1549 | - | |||||||||||||||||||||||||
1550 | updateHitCountAndTimeStamp(it.value()); | - | ||||||||||||||||||||||||
1551 | - | |||||||||||||||||||||||||
1552 | return never executed: it.value().data;return it.value().data; never executed: return it.value().data; | 0 | ||||||||||||||||||||||||
1553 | } | - | ||||||||||||||||||||||||
1554 | - | |||||||||||||||||||||||||
1555 | void QFontCache::updateHitCountAndTimeStamp(Engine &value) | - | ||||||||||||||||||||||||
1556 | { | - | ||||||||||||||||||||||||
1557 | value.hits++; | - | ||||||||||||||||||||||||
1558 | value.timestamp = ++current_timestamp; | - | ||||||||||||||||||||||||
1559 | - | |||||||||||||||||||||||||
1560 | if (false) QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" dead code: QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type()); | - | ||||||||||||||||||||||||
1561 | " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", dead code: QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type()); | - | ||||||||||||||||||||||||
1562 | value.data, value.timestamp, value.hits, dead code: QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type()); | - | ||||||||||||||||||||||||
1563 | value.data->ref.load(), engineCacheCount.value(value.data), dead code: QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type()); | - | ||||||||||||||||||||||||
1564 | value.data->type()); dead code: QMessageLogger(__FILE__, 2829, __PRETTY_FUNCTION__).debug("QFontCache: found font engine\n" " %p: timestamp %4u hits %3u ref %2d/%2d, type %d", value.data, value.timestamp, value.hits, value.data->ref.load(), engineCacheCount.value(value.data), value.data->type()); | - | ||||||||||||||||||||||||
1565 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1566 | - | |||||||||||||||||||||||||
1567 | void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti) | - | ||||||||||||||||||||||||
1568 | { | - | ||||||||||||||||||||||||
1569 | ((!(engine != nullptr)) ? qt_assert("engine != Q_NULLPTR",__FILE__,2838) : qt_noop()); | - | ||||||||||||||||||||||||
1570 | ((!(key.multi == (engine->type() == QFontEngine::Multi))) ? qt_assert("key.multi == (engine->type() == QFontEngine::Multi)",__FILE__,2839) : qt_noop()); | - | ||||||||||||||||||||||||
1571 | engine->ref.ref(); | - | ||||||||||||||||||||||||
1572 | - | |||||||||||||||||||||||||
1573 | if (total_cost > min_cost * 2
| 0 | ||||||||||||||||||||||||
1574 | decreaseCache(); never executed: decreaseCache(); | 0 | ||||||||||||||||||||||||
1575 | - | |||||||||||||||||||||||||
1576 | Engine data(engine); | - | ||||||||||||||||||||||||
1577 | data.timestamp = ++current_timestamp; | - | ||||||||||||||||||||||||
1578 | - | |||||||||||||||||||||||||
1579 | if (insertMulti
| 0 | ||||||||||||||||||||||||
1580 | engineCache.insertMulti(key, data); never executed: engineCache.insertMulti(key, data); | 0 | ||||||||||||||||||||||||
1581 | else | - | ||||||||||||||||||||||||
1582 | engineCache.insert(key, data); never executed: engineCache.insert(key, data); | 0 | ||||||||||||||||||||||||
1583 | - | |||||||||||||||||||||||||
1584 | if (++
| 0 | ||||||||||||||||||||||||
1585 | increaseCost(engine->cache_cost); never executed: increaseCost(engine->cache_cost); | 0 | ||||||||||||||||||||||||
1586 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1587 | - | |||||||||||||||||||||||||
1588 | void QFontCache::increaseCost(uint cost) | - | ||||||||||||||||||||||||
1589 | { | - | ||||||||||||||||||||||||
1590 | cost = (cost + 512) / 1024; | - | ||||||||||||||||||||||||
1591 | cost = cost > 0
| 0 | ||||||||||||||||||||||||
1592 | total_cost += cost; | - | ||||||||||||||||||||||||
1593 | - | |||||||||||||||||||||||||
1594 | if (false) QMessageLogger(__FILE__, 2872, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb", dead code: QMessageLogger(__FILE__, 2872, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost); | - | ||||||||||||||||||||||||
1595 | cost, total_cost, max_cost); dead code: QMessageLogger(__FILE__, 2872, __PRETTY_FUNCTION__).debug(" COST: increased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost); | - | ||||||||||||||||||||||||
1596 | - | |||||||||||||||||||||||||
1597 | if (total_cost > max_cost
| 0 | ||||||||||||||||||||||||
1598 | max_cost = total_cost; | - | ||||||||||||||||||||||||
1599 | - | |||||||||||||||||||||||||
1600 | if (timer_id == -1
| 0 | ||||||||||||||||||||||||
1601 | if (false) QMessageLogger(__FILE__, 2879, __PRETTY_FUNCTION__).debug(" TIMER: starting fast timer (%d ms)", fast_timeout); dead code: QMessageLogger(__FILE__, 2879, __PRETTY_FUNCTION__).debug(" TIMER: starting fast timer (%d ms)", fast_timeout); | - | ||||||||||||||||||||||||
1602 | - | |||||||||||||||||||||||||
1603 | if (timer_id != -1
never executed: killTimer(timer_id); | 0 | ||||||||||||||||||||||||
1604 | timer_id = startTimer(fast_timeout); | - | ||||||||||||||||||||||||
1605 | fast = true; | - | ||||||||||||||||||||||||
1606 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1607 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1608 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1609 | - | |||||||||||||||||||||||||
1610 | void QFontCache::decreaseCost(uint cost) | - | ||||||||||||||||||||||||
1611 | { | - | ||||||||||||||||||||||||
1612 | cost = (cost + 512) / 1024; | - | ||||||||||||||||||||||||
1613 | cost = cost > 0
| 0 | ||||||||||||||||||||||||
1614 | ((!(cost <= total_cost)) ? qt_assert("cost <= total_cost",__FILE__,2892) : qt_noop()); | - | ||||||||||||||||||||||||
1615 | total_cost -= cost; | - | ||||||||||||||||||||||||
1616 | - | |||||||||||||||||||||||||
1617 | if (false) QMessageLogger(__FILE__, 2895, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb", dead code: QMessageLogger(__FILE__, 2895, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost); | - | ||||||||||||||||||||||||
1618 | cost, total_cost, max_cost); dead code: QMessageLogger(__FILE__, 2895, __PRETTY_FUNCTION__).debug(" COST: decreased %u kb, total_cost %u kb, max_cost %u kb", cost, total_cost, max_cost); | - | ||||||||||||||||||||||||
1619 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1620 | - | |||||||||||||||||||||||||
1621 | void QFontCache::timerEvent(QTimerEvent *) | - | ||||||||||||||||||||||||
1622 | { | - | ||||||||||||||||||||||||
1623 | if (false) QMessageLogger(__FILE__, 2901, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", dead code: QMessageLogger(__FILE__, 2901, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", current_timestamp); | - | ||||||||||||||||||||||||
1624 | current_timestamp); dead code: QMessageLogger(__FILE__, 2901, __PRETTY_FUNCTION__).debug("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", current_timestamp); | - | ||||||||||||||||||||||||
1625 | - | |||||||||||||||||||||||||
1626 | if (total_cost <= max_cost
| 0 | ||||||||||||||||||||||||
1627 | if (false) QMessageLogger(__FILE__, 2905, __PRETTY_FUNCTION__).debug(" cache redused sufficiently, stopping timer"); dead code: QMessageLogger(__FILE__, 2905, __PRETTY_FUNCTION__).debug(" cache redused sufficiently, stopping timer"); | - | ||||||||||||||||||||||||
1628 | - | |||||||||||||||||||||||||
1629 | killTimer(timer_id); | - | ||||||||||||||||||||||||
1630 | timer_id = -1; | - | ||||||||||||||||||||||||
1631 | fast = false; | - | ||||||||||||||||||||||||
1632 | - | |||||||||||||||||||||||||
1633 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1634 | } | - | ||||||||||||||||||||||||
1635 | decreaseCache(); | - | ||||||||||||||||||||||||
1636 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1637 | - | |||||||||||||||||||||||||
1638 | void QFontCache::decreaseCache() | - | ||||||||||||||||||||||||
1639 | { | - | ||||||||||||||||||||||||
1640 | - | |||||||||||||||||||||||||
1641 | uint in_use_cost = 0; | - | ||||||||||||||||||||||||
1642 | - | |||||||||||||||||||||||||
1643 | { | - | ||||||||||||||||||||||||
1644 | if (false) QMessageLogger(__FILE__, 2922, __PRETTY_FUNCTION__).debug(" SWEEP engine data:"); dead code: QMessageLogger(__FILE__, 2922, __PRETTY_FUNCTION__).debug(" SWEEP engine data:"); | - | ||||||||||||||||||||||||
1645 | - | |||||||||||||||||||||||||
1646 | - | |||||||||||||||||||||||||
1647 | const uint engine_data_cost = | - | ||||||||||||||||||||||||
1648 | sizeof(QFontEngineData) > 1024
| 0 | ||||||||||||||||||||||||
1649 | - | |||||||||||||||||||||||||
1650 | EngineDataCache::ConstIterator it = engineDataCache.constBegin(), | - | ||||||||||||||||||||||||
1651 | end = engineDataCache.constEnd(); | - | ||||||||||||||||||||||||
1652 | for (; it != end
| 0 | ||||||||||||||||||||||||
1653 | if (false) QMessageLogger(__FILE__, 2931, __PRETTY_FUNCTION__).debug(" %p: ref %2d", it.value(), int(it.value()->ref.load())); dead code: QMessageLogger(__FILE__, 2931, __PRETTY_FUNCTION__).debug(" %p: ref %2d", it.value(), int(it.value()->ref.load())); | - | ||||||||||||||||||||||||
1654 | - | |||||||||||||||||||||||||
1655 | if (it.value()->ref.load() != 1
| 0 | ||||||||||||||||||||||||
1656 | in_use_cost += engine_data_cost; never executed: in_use_cost += engine_data_cost; | 0 | ||||||||||||||||||||||||
1657 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1658 | } | - | ||||||||||||||||||||||||
1659 | - | |||||||||||||||||||||||||
1660 | { | - | ||||||||||||||||||||||||
1661 | if (false) QMessageLogger(__FILE__, 2939, __PRETTY_FUNCTION__).debug(" SWEEP engine:"); dead code: QMessageLogger(__FILE__, 2939, __PRETTY_FUNCTION__).debug(" SWEEP engine:"); | - | ||||||||||||||||||||||||
1662 | - | |||||||||||||||||||||||||
1663 | EngineCache::ConstIterator it = engineCache.constBegin(), | - | ||||||||||||||||||||||||
1664 | end = engineCache.constEnd(); | - | ||||||||||||||||||||||||
1665 | for (; it != end
| 0 | ||||||||||||||||||||||||
1666 | if (false) QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", dead code: QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost); | - | ||||||||||||||||||||||||
1667 | it.value().data, it.value().timestamp, it.value().hits, dead code: QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost); | - | ||||||||||||||||||||||||
1668 | it.value().data->ref.load(), engineCacheCount.value(it.value().data), dead code: QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost); | - | ||||||||||||||||||||||||
1669 | it.value().data->cache_cost); dead code: QMessageLogger(__FILE__, 2944, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->cache_cost); | - | ||||||||||||||||||||||||
1670 | - | |||||||||||||||||||||||||
1671 | if (it.value().data->ref.load() != 0
| 0 | ||||||||||||||||||||||||
1672 | in_use_cost += it.value().data->cache_cost / engineCacheCount.value(it.value().data); never executed: in_use_cost += it.value().data->cache_cost / engineCacheCount.value(it.value().data); | 0 | ||||||||||||||||||||||||
1673 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1674 | - | |||||||||||||||||||||||||
1675 | - | |||||||||||||||||||||||||
1676 | in_use_cost += engineCache.size(); | - | ||||||||||||||||||||||||
1677 | } | - | ||||||||||||||||||||||||
1678 | - | |||||||||||||||||||||||||
1679 | in_use_cost = (in_use_cost + 512) / 1024; | - | ||||||||||||||||||||||||
1680 | uint new_max_cost = qMax(qMax(max_cost / 2, in_use_cost), min_cost); | - | ||||||||||||||||||||||||
1681 | - | |||||||||||||||||||||||||
1682 | if (false) QMessageLogger(__FILE__, 2969, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb", dead code: QMessageLogger(__FILE__, 2969, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb", in_use_cost, total_cost, max_cost, new_max_cost); | - | ||||||||||||||||||||||||
1683 | in_use_cost, total_cost, max_cost, new_max_cost); dead code: QMessageLogger(__FILE__, 2969, __PRETTY_FUNCTION__).debug(" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb", in_use_cost, total_cost, max_cost, new_max_cost); | - | ||||||||||||||||||||||||
1684 | - | |||||||||||||||||||||||||
1685 | if (new_max_cost == max_cost
| 0 | ||||||||||||||||||||||||
1686 | if (fast
| 0 | ||||||||||||||||||||||||
1687 | if (false) QMessageLogger(__FILE__, 2974, __PRETTY_FUNCTION__).debug(" cannot shrink cache, slowing timer"); dead code: QMessageLogger(__FILE__, 2974, __PRETTY_FUNCTION__).debug(" cannot shrink cache, slowing timer"); | - | ||||||||||||||||||||||||
1688 | - | |||||||||||||||||||||||||
1689 | killTimer(timer_id); | - | ||||||||||||||||||||||||
1690 | timer_id = startTimer(slow_timeout); | - | ||||||||||||||||||||||||
1691 | fast = false; | - | ||||||||||||||||||||||||
1692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1693 | - | |||||||||||||||||||||||||
1694 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1695 | } else if (! fast
| 0 | ||||||||||||||||||||||||
1696 | if (false) QMessageLogger(__FILE__, 2983, __PRETTY_FUNCTION__).debug(" dropping into passing gear"); dead code: QMessageLogger(__FILE__, 2983, __PRETTY_FUNCTION__).debug(" dropping into passing gear"); | - | ||||||||||||||||||||||||
1697 | - | |||||||||||||||||||||||||
1698 | killTimer(timer_id); | - | ||||||||||||||||||||||||
1699 | timer_id = startTimer(fast_timeout); | - | ||||||||||||||||||||||||
1700 | fast = true; | - | ||||||||||||||||||||||||
1701 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1702 | - | |||||||||||||||||||||||||
1703 | max_cost = new_max_cost; | - | ||||||||||||||||||||||||
1704 | - | |||||||||||||||||||||||||
1705 | { | - | ||||||||||||||||||||||||
1706 | if (false) QMessageLogger(__FILE__, 2993, __PRETTY_FUNCTION__).debug(" CLEAN engine data:"); dead code: QMessageLogger(__FILE__, 2993, __PRETTY_FUNCTION__).debug(" CLEAN engine data:"); | - | ||||||||||||||||||||||||
1707 | - | |||||||||||||||||||||||||
1708 | - | |||||||||||||||||||||||||
1709 | EngineDataCache::Iterator it = engineDataCache.begin(); | - | ||||||||||||||||||||||||
1710 | while (it != engineDataCache.end()
| 0 | ||||||||||||||||||||||||
1711 | if (it.value()->ref.load() == 1
| 0 | ||||||||||||||||||||||||
1712 | if (false) QMessageLogger(__FILE__, 2999, __PRETTY_FUNCTION__).debug(" %p", it.value()); dead code: QMessageLogger(__FILE__, 2999, __PRETTY_FUNCTION__).debug(" %p", it.value()); | - | ||||||||||||||||||||||||
1713 | decreaseCost(sizeof(QFontEngineData)); | - | ||||||||||||||||||||||||
1714 | it.value()->ref.deref(); | - | ||||||||||||||||||||||||
1715 | delete it.value(); | - | ||||||||||||||||||||||||
1716 | it = engineDataCache.erase(it); | - | ||||||||||||||||||||||||
1717 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1718 | ++it; | - | ||||||||||||||||||||||||
1719 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1720 | } | - | ||||||||||||||||||||||||
1721 | } | - | ||||||||||||||||||||||||
1722 | - | |||||||||||||||||||||||||
1723 | if (false) QMessageLogger(__FILE__, 3010, __PRETTY_FUNCTION__).debug(" CLEAN engine:"); dead code: QMessageLogger(__FILE__, 3010, __PRETTY_FUNCTION__).debug(" CLEAN engine:"); | - | ||||||||||||||||||||||||
1724 | - | |||||||||||||||||||||||||
1725 | - | |||||||||||||||||||||||||
1726 | bool cost_decreased; | - | ||||||||||||||||||||||||
1727 | do { | - | ||||||||||||||||||||||||
1728 | cost_decreased = false; | - | ||||||||||||||||||||||||
1729 | - | |||||||||||||||||||||||||
1730 | EngineCache::Iterator it = engineCache.begin(), | - | ||||||||||||||||||||||||
1731 | end = engineCache.end(); | - | ||||||||||||||||||||||||
1732 | - | |||||||||||||||||||||||||
1733 | uint oldest = ~0u; | - | ||||||||||||||||||||||||
1734 | uint least_popular = ~0u; | - | ||||||||||||||||||||||||
1735 | - | |||||||||||||||||||||||||
1736 | EngineCache::Iterator jt = end; | - | ||||||||||||||||||||||||
1737 | - | |||||||||||||||||||||||||
1738 | for ( ; it != end
| 0 | ||||||||||||||||||||||||
1739 | if (it.value().data->ref.load() != engineCacheCount.value(it.value().data)
| 0 | ||||||||||||||||||||||||
1740 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
1741 | - | |||||||||||||||||||||||||
1742 | if (it.value().timestamp < oldest
| 0 | ||||||||||||||||||||||||
1743 | oldest = it.value().timestamp; | - | ||||||||||||||||||||||||
1744 | least_popular = it.value().hits; | - | ||||||||||||||||||||||||
1745 | jt = it; | - | ||||||||||||||||||||||||
1746 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1747 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1748 | - | |||||||||||||||||||||||||
1749 | it = jt; | - | ||||||||||||||||||||||||
1750 | if (it != end
| 0 | ||||||||||||||||||||||||
1751 | if (false) QMessageLogger(__FILE__, 3038, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", dead code: QMessageLogger(__FILE__, 3038, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type()); | - | ||||||||||||||||||||||||
1752 | it.value().data, it.value().timestamp, it.value().hits, dead code: QMessageLogger(__FILE__, 3038, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type()); | - | ||||||||||||||||||||||||
1753 | it.value().data->ref.load(), engineCacheCount.value(it.value().data), dead code: QMessageLogger(__FILE__, 3038, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type()); | - | ||||||||||||||||||||||||
1754 | it.value().data->type()); dead code: QMessageLogger(__FILE__, 3038, __PRETTY_FUNCTION__).debug(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d", it.value().data, it.value().timestamp, it.value().hits, it.value().data->ref.load(), engineCacheCount.value(it.value().data), it.value().data->type()); | - | ||||||||||||||||||||||||
1755 | - | |||||||||||||||||||||||||
1756 | QFontEngine *fontEngine = it.value().data; | - | ||||||||||||||||||||||||
1757 | - | |||||||||||||||||||||||||
1758 | it = engineCache.begin(); | - | ||||||||||||||||||||||||
1759 | while (it != engineCache.end()
| 0 | ||||||||||||||||||||||||
1760 | if (it.value().data == fontEngine
| 0 | ||||||||||||||||||||||||
1761 | fontEngine->ref.deref(); | - | ||||||||||||||||||||||||
1762 | it = engineCache.erase(it); | - | ||||||||||||||||||||||||
1763 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1764 | ++it; | - | ||||||||||||||||||||||||
1765 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1766 | } | - | ||||||||||||||||||||||||
1767 | - | |||||||||||||||||||||||||
1768 | ((!(fontEngine->ref.load() == 0)) ? qt_assert("fontEngine->ref.load() == 0",__FILE__,3055) : qt_noop()); | - | ||||||||||||||||||||||||
1769 | decreaseCost(fontEngine->cache_cost); | - | ||||||||||||||||||||||||
1770 | delete fontEngine; | - | ||||||||||||||||||||||||
1771 | engineCacheCount.remove(fontEngine); | - | ||||||||||||||||||||||||
1772 | - | |||||||||||||||||||||||||
1773 | cost_decreased = true; | - | ||||||||||||||||||||||||
1774 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1775 | } never executed: while (cost_decreasedend of block
| 0 | ||||||||||||||||||||||||
1776 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1777 | - | |||||||||||||||||||||||||
1778 | - | |||||||||||||||||||||||||
1779 | - | |||||||||||||||||||||||||
1780 | QDebug operator<<(QDebug stream, const QFont &font) | - | ||||||||||||||||||||||||
1781 | { | - | ||||||||||||||||||||||||
1782 | return never executed: stream << "QFont(" << font.toString() << ')';return stream << "QFont(" << font.toString() << ')'; never executed: return stream << "QFont(" << font.toString() << ')'; | 0 | ||||||||||||||||||||||||
1783 | } | - | ||||||||||||||||||||||||
1784 | - | |||||||||||||||||||||||||
1785 | - | |||||||||||||||||||||||||
1786 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |