57 #include <private/qunicodetables_p.h> 59 #include <private/qfontengine_p.h> 60 #include <private/qpainter_p.h> 61 #include <private/qtextengine_p.h> 66 #include <private/qt_x11_p.h> 70 #if !defined(QT_NO_QWS_QPF2) 76 #include <private/qt_s60_p.h> 79 #include <QtGui/qplatformscreen_qpa.h> 80 #include <QtGui/private/qapplication_p.h> 83 #include <QMutexLocker> 86 #ifdef QFONTCACHE_DEBUG 87 # define FC_DEBUG qDebug 89 # define FC_DEBUG if (false) qDebug 138 QString this_family, this_foundry, other_family, other_foundry;
149 && this_family == other_family
153 || this_foundry == other_foundry)
170 #elif defined(Q_WS_WIN) 171 dpi = GetDeviceCaps(
shared_dc(),LOGPIXELSX);
172 #elif defined(Q_WS_MAC) 175 #elif defined(Q_WS_QWS) 181 screen = subScreens.
at(0);
183 #elif defined(Q_WS_QPA) 186 QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
194 #elif defined(Q_OS_SYMBIAN) 195 dpi = S60->defaultDpiX;
209 #elif defined(Q_WS_WIN) 210 dpi = GetDeviceCaps(
shared_dc(),LOGPIXELSY);
211 #elif defined(Q_WS_MAC) 214 #elif defined(Q_WS_QWS) 220 screen = subScreens.
at(0);
222 #elif defined(Q_WS_QPA) 225 QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
233 #elif defined(Q_OS_SYMBIAN) 234 dpi = S60->defaultDpiY;
247 rawMode(false), underline(false), overline(false), strikeOut(false),
kerning(true),
248 capital(0), letterSpacingIsAbsolute(false), scFont(0)
288 #if !defined(Q_WS_MAC) 289 #define QT_FONT_ENGINE_FROM_DATA(data, script) data->engines[script] 291 #define QT_FONT_ENGINE_FROM_DATA(data, script) data->engine 327 QFont font(const_cast<QFontPrivate *>(
this));
409 #if !defined(Q_WS_MAC) 418 #if !defined(Q_WS_MAC) 428 #endif // Q_WS_X11 || Q_WS_WIN || Q_WS_MAC 766 : resolve_mask(font.resolve_mask)
772 int screen = info ? info->
screen() : 0;
774 const int screen = 0;
776 if (font.
d->
dpi != dpi || font.
d->
screen != screen ) {
849 if (pointSize <= 0) {
929 #if defined(Q_WS_X11) 1101 if (pointSize <= 0) {
1102 qWarning(
"QFont::setPointSize: Point size <= 0 (%d), must be greater than 0", pointSize);
1123 if (pointSize <= 0) {
1124 qWarning(
"QFont::setPointSizeF: Point size <= 0 (%f), must be greater than 0", pointSize);
1158 if (pixelSize <= 0) {
1159 qWarning(
"QFont::setPixelSize: Pixel size <= 0 (%d)", pixelSize);
1280 Q_ASSERT_X(weight >= 0 && weight <= 99,
"QFont::setWeight",
"Weight must be between 0 and 99");
1568 #if defined(Q_WS_X11) 1643 if (factor < 1 || factor > 4000) {
1644 qWarning(
"QFont::setStretch: Parameter '%d' out of range", factor);
1846 if ((
bool)
d->
rawMode == enable)
return;
1906 if (f.
d ==
d)
return false;
1929 return f1attrs < f2attrs;
2019 QFont QFont::defaultFont()
2031 void QFont::setDefaultFont(
const QFont &f)
2071 static const char *
const initTbl[] = {
2073 #if defined(Q_WS_X11) 2074 "arial",
"helvetica",
2075 "times new roman",
"times",
2076 "courier new",
"courier",
2077 "sans serif",
"helvetica",
2078 #elif defined(Q_WS_MAC) 2079 ".lucida grande ui",
"lucida grande",
2080 #elif defined(Q_WS_WIN) 2081 "times",
"times new roman",
2082 "courier",
"courier new",
2083 "helvetica",
"arial",
2084 "sans serif",
"arial",
2094 #if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) 2095 if (
X11->has_fontconfig)
2099 for (
int i=0; initTbl[i] != 0; i += 2) {
2123 if (it != fontSubst->
constEnd() && !(*it).isEmpty())
2124 return (*it).first();
2156 const QString &substituteName)
2184 while (it != substituteNames.
constEnd()) {
2243 while (it != fontSubst->
constEnd()) {
2295 #ifndef QT_NO_DATASTREAM 2310 f->
rawMode = (bits & 0x20) != 0;
2312 f->
kerning = (bits & 0x10) != 0;
2313 if ((bits & 0x80) != 0)
2347 return family() + comma +
2371 int count =
l.count();
2372 if (!count || (count > 2 && count < 9) || count > 11) {
2373 qWarning(
"QFont::fromString: Invalid description '%s'",
2389 }
else if (count == 10) {
2406 #if !defined(Q_WS_QWS) 2414 void QFont::cacheStatistics()
2426 #ifndef QT_NO_DATASTREAM 2453 }
else if (s.
version() <= 3) {
2455 if (pointSize < 0) {
2564 #endif // QT_NO_DATASTREAM 2894 #ifdef QFONTCACHE_DEBUG 2901 #endif // QFONTCACHE_DEBUG 2910 return theFontCache();
2921 QFontCache *&fontCache = theFontCache()->localData();
2931 cache = theFontCache();
2932 }
QT_CATCH (
const std::bad_alloc &) {
2938 #endif // QT_NO_THREAD 2941 :
QObject(), total_cost(0), max_cost(min_cost),
2942 current_timestamp(0), fast(false),
timer_id(-1)
2953 if (it.
value()->ref == 0)
2956 FC_DEBUG(
"QFontCache::~QFontCache: engineData %p still has refcount %d",
2964 if (--it.value().data->cache_count == 0) {
2965 if (it.value().data->ref == 0) {
2966 FC_DEBUG(
"QFontCache::~QFontCache: deleting engine %p key=(%d / %g %g %d %d %d)",
2967 it.value().data, it.key().script, it.key().def.pointSize,
2968 it.key().def.pixelSize, it.key().def.weight, it.key().def.style,
2969 it.key().def.fixedPitch);
2971 delete it.value().data;
2973 FC_DEBUG(
"QFontCache::~QFontCache: engine = %p still has refcount %d",
2974 it.value().data, int(it.value().data->ref));
2988 #if !defined(Q_WS_MAC) 2990 if (data->engines[i]) {
2992 data->engines[i] = 0;
3007 if (
it->data->ref == 0) {
3015 if (
it->data &&
it->data->ref == 0) {
3024 #if defined(Q_WS_QWS) && !defined(QT_NO_QWS_QPF2) 3040 if (it ==
end)
return 0;
3048 FC_DEBUG(
"QFontCache: inserting new engine data %p", engineData);
3058 if (it ==
end)
return 0;
3064 FC_DEBUG(
"QFontCache: found font engine\n" 3065 " %p: timestamp %4u hits %3u ref %2d/%2d, type '%s'",
3066 it.value().data, it.value().timestamp, it.value().hits,
3067 int(it.value().data->ref), it.value().data->cache_count,
3068 it.value().data->name());
3070 return it.value().data;
3075 FC_DEBUG(
"QFontCache: inserting new engine %p", engine);
3091 cost = (cost + 512) / 1024;
3092 cost = cost > 0 ? cost : 1;
3095 FC_DEBUG(
" COST: increased %u kb, total_cost %u kb, max_cost %u kb",
3113 cost = (cost + 512) / 1024;
3114 cost = cost > 0 ? cost : 1;
3118 FC_DEBUG(
" COST: decreased %u kb, total_cost %u kb, max_cost %u kb",
3122 #if defined(Q_WS_WIN) || defined (Q_WS_QWS) 3125 FC_DEBUG(
"QFontCache::cleanupPrinterFonts");
3139 if(it.
value()->ref != 0) {
3141 if(it.
value()->engines[i]) {
3142 it.
value()->engines[i]->ref.deref();
3143 it.
value()->engines[i] = 0;
3164 if (it.value().data->ref != 0 || it.key().screen == 0) {
3169 FC_DEBUG(
" %p: timestamp %4u hits %2u ref %2d/%2d, type '%s'",
3170 it.value().data, it.value().timestamp, it.value().hits,
3171 int(it.value().data->ref), it.value().data->cache_count,
3172 it.value().data->name());
3174 if (--it.value().data->cache_count == 0) {
3175 FC_DEBUG(
" DELETE: last occurrence in cache");
3178 delete it.value().data;
3188 FC_DEBUG(
"QFontCache::timerEvent: performing cache maintenance (timestamp %u)",
3192 FC_DEBUG(
" cache redused sufficiently, stopping timer");
3202 uint in_use_cost = 0;
3208 const uint engine_data_cost =
3213 for (; it !=
end; ++
it) {
3214 #ifdef QFONTCACHE_DEBUG 3217 # if defined(Q_WS_X11) || defined(Q_WS_WIN) 3220 if (! it.
value()->engines[i])
3224 # endif // Q_WS_X11 || Q_WS_WIN 3225 #endif // QFONTCACHE_DEBUG 3227 if (it.
value()->ref != 0)
3228 in_use_cost += engine_data_cost;
3237 for (; it !=
end; ++
it) {
3238 FC_DEBUG(
" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes",
3239 it.value().data, it.value().timestamp, it.value().hits,
3240 int(it.value().data->ref), it.value().data->cache_count,
3241 it.value().data->cache_cost);
3243 if (it.value().data->ref != 0)
3244 in_use_cost += it.value().data->cache_cost / it.value().data->cache_count;
3251 in_use_cost = (in_use_cost + 512) / 1024;
3263 FC_DEBUG(
" after sweep, in use %u kb, total %u kb, max %u kb, new max %u kb",
3268 FC_DEBUG(
" cannot shrink cache, slowing timer");
3276 }
else if (!
fast) {
3277 FC_DEBUG(
" dropping into passing gear");
3293 if (it.
value()->ref != 0) {
3318 uint least_popular = ~0
u;
3320 for (; it !=
end; ++
it) {
3321 if (it.value().data->ref != 0)
3324 if (it.value().timestamp < oldest &&
3325 it.value().hits <= least_popular) {
3326 oldest = it.value().timestamp;
3327 least_popular = it.value().hits;
3331 FC_DEBUG(
" oldest %u least popular %u", oldest, least_popular);
3334 if (it.value().data->ref == 0 &&
3335 it.value().timestamp == oldest &&
3336 it.value().hits == least_popular)
3341 FC_DEBUG(
" %p: timestamp %4u hits %2u ref %2d/%2d, type '%s'",
3342 it.value().data, it.value().timestamp, it.value().hits,
3343 int(it.value().data->ref), it.value().data->cache_count,
3344 it.value().data->name());
3346 if (--it.value().data->cache_count == 0) {
3347 FC_DEBUG(
" DELETE: last occurrence in cache");
3350 delete it.value().data;
3366 #ifndef QT_NO_DEBUG_STREAM 3369 return stream <<
"QFont(" << font.
toString() <<
')';
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
Q_GUI_EXPORT QScreen * qt_screen
void setWordSpacing(qreal spacing)
Sets the word spacing for the font to spacing.
The QDebug class provides an output stream for debugging information.
void setPointSize(int)
Sets the point size to pointSize.
QFontInfo(const QFont &)
Constructs a font info object for font.
The QApplication class manages the GUI application's control flow and main settings.
const Key & key() const
Returns the current item's key as a const reference.
void setCapitalization(Capitalization)
Sets the capitalization of the text in this font to caps.
HintingPreference
This enum describes the different levels of hinting that can be applied to glyphs to improve legibili...
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
QFontInfo & operator=(const QFontInfo &)
Assigns the font info in fi.
int height() const
Returns the logical height of the framebuffer in pixels.
#define QT_FONT_ENGINE_FROM_DATA(data, script)
static mach_timebase_info_data_t info
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
The QMutex class provides access serialization between threads.
char * data()
Returns a pointer to the data stored in the byte array.
bool letterSpacingIsAbsolute
static int appScreen()
Returns the number of the screen where the application is being displayed.
int remove(const Key &key)
Removes all the items that have the key from the hash.
void setKerning(bool)
Enables kerning for this font if enable is true; otherwise disables it.
int physicalHeight() const
Returns the physical height of the screen in millimeters.
bool operator==(const QFont &) const
Returns true if this font is equal to f; otherwise returns false.
HintingPreference hintingPreference() const
Returns the currently preferred hinting level for glyphs rendered with this font. ...
#define it(className, varName)
static const uint min_cost
bool fromString(const QString &)
Sets this font to match the description descrip.
bool underline() const
Returns true if underline has been set; otherwise returns false.
int weight() const
Returns the weight of the matched window system font.
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
Q_GUI_EXPORT int qt_defaultDpiY()
int pixelSize() const
Returns the pixel size of the font if it was set with setPixelSize().
The QByteArray class provides an array of bytes.
Q_GUI_EXPORT int qt_defaultDpiX()
Style style() const
Returns the style of the font.
int size() const
Returns the number of (key, value) pairs in the map.
void insertEngine(const Key &key, QFontEngine *engine)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Capitalization capitalization() const
Returns the current capitalization type of the font.
void decreaseCost(uint cost)
void setRawMode(bool)
If enable is true, turns raw mode on; otherwise turns raw mode off.
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
bool ref()
Atomically increments the value of this QAtomicInt.
static void parseFontName(const QString &name, QString &foundry, QString &family)
friend Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QFont &)
Reads the font font from the data stream s.
The QString class provides a Unicode character string.
void setItalic(bool b)
Sets the style() of the font to QFont::StyleItalic if enable is true; otherwise the style is set to Q...
The QHash class is a template class that provides a hash-table-based dictionary.
static void load(const QFontPrivate *d, int script)
Loads a QFontEngine for the specified script that matches the QFontDef request member variable...
static QFixed fromReal(qreal r)
Capitalization
Rendering option for text this font applies to.
bool isCopyOf(const QFont &) const
Returns true if this font and f are copies of each other, i.e.
The QObject class is the base class of all Qt objects.
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const =0
QFontPrivate * smallCapsFontPrivate() const
static QString substitute(const QString &)
Returns the first family name to be used whenever familyName is specified.
float qt_mac_defaultDpi_y()
QFont & operator=(const QFont &)
Assigns font to this font and returns a reference to it.
bool kerning() const
Returns true if kerning should be used when drawing text with this font.
virtual Type type() const =0
virtual int devType() const
The QChar class provides a 16-bit Unicode character.
void setHintingPreference(HintingPreference hintingPreference)
Set the preference for the hinting level of the glyphs to hintingPreference.
QString styleName() const
Returns the requested font style name, it will be used to match the font with irregular styles (that ...
const T value(const Key &key) const
Returns the value associated with the key.
void setStyleStrategy(StyleStrategy s)
Sets the style strategy for the font to s.
QString styleName() const
Returns the style name of the matched window system font on system that supports it.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
static QFontCache * instance()
const QX11Info * qt_x11Info(const QPaintDevice *pd)
static QFont font()
Returns the default application font.
bool italic() const
Returns the italic value of the matched window system font.
void setFamily(const QString &)
Sets the family name of the font.
T & value() const
Returns a modifiable reference to the current item's value.
const Key & key() const
Returns the current item's key.
int width() const
Returns the logical width of the framebuffer in pixels.
int width() const
Returns the width.
void append(const T &t)
Inserts value at the end of the list.
T * data() const
Returns a pointer to the shared data object.
const Q_GUI_EXPORT QX11Info * qt_x11Info(const QPaintDevice *pd)
Returns the QX11Info structure for the pd paint device.
#define QT_BEGIN_NAMESPACE
This macro expands to.
qreal pointSizeF() const
Returns the point size of the font.
void removeEngineForFont(const QByteArray &fontName)
void sort()
Sorts the list of strings in ascending order (case sensitively).
void setStretch(int)
Sets the stretch factor for the font.
const_iterator ConstIterator
Qt-style synonym for QMap::const_iterator.
static void removeSubstitution(const QString &)
Removes all the substitutions for familyName.
bool overline() const
Returns true if overline has been set; otherwise returns false.
static QList< QAxEngineDescriptor > engines
QDebug operator<<(QDebug stream, const QFont &font)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool strikeOut() const
Returns the strikeout value of the matched window system font.
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
static int appDpiX(int screen=-1)
Returns the horizontal resolution of the given screen in terms of the number of dots per inch...
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
void insertEngineData(const Key &key, QFontEngineData *engineData)
static quint8 get_font_bits(int version, const QFontPrivate *f)
static void insertSubstitutions(const QString &, const QStringList &)
Inserts the list of families substituteNames into the substitution list for familyName.
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
bool deref()
Atomically decrements the value of this QAtomicInt.
bool underline() const
Returns the underline value of the matched window system font.
The QStringList class provides a list of strings.
iterator Iterator
Qt-style synonym for QMap::iterator.
static int toInt(const QByteArray &str)
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Q_CORE_EXPORT void qWarning(const char *,...)
SpacingType letterSpacingType() const
Returns the spacing type used for letter spacing.
static const char * data(const QByteArray &arr)
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
bool operator<(const QFont &) const
Provides an arbitrary comparison of this font and font f.
QString toString() const
Returns a description of the font.
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static QString resolveFontFamilyAlias(const QString &family)
EngineDataCache engineDataCache
int pixelSize() const
Returns the pixel size of the matched window system font.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
static void set_font_bits(int version, quint8 bits, QFontPrivate *f)
void setStyleHint(StyleHint, StyleStrategy=PreferDefault)
Sets the style hint and strategy to hint and strategy, respectively.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
friend class QFontPrivate
The QFontInfo class provides general information about fonts.
Style
This enum describes the different styles of glyphs that are used to display text. ...
QFont::Style style() const
Returns the style value of the matched window system font.
static const int slow_timeout
qreal wordSpacing() const
Returns the word spacing for the font.
static void insertSubstitution(const QString &, const QString &)
Inserts substituteName into the substitution table for the family familyName.
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
QFontEngine * engineForScript(int script) const
QFont()
Constructs a font object that uses the application's default font.
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
int version() const
Returns the version number of the data serialization format.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
static quint8 get_extended_font_bits(const QFontPrivate *f)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
bool fixedPitch() const
Returns the fixed pitch value of the matched window system font.
#define Q_ASSERT_X(cond, where, what)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
virtual HDC getDC() const
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
bool hasLocalData() const
If T is a pointer type, returns true if the calling thread has non-zero data available.
~QFont()
Destroys the font object and frees all allocated resources.
StyleHint
Style hints are used by the font matching algorithm to find an appropriate default family if a select...
The QX11Info class provides information about the X display configuration.
static QStringList substitutes(const QString &)
Returns a list of family names to be used whenever familyName is specified.
bool fixedPitch() const
Returns true if fixed pitch has been set; otherwise returns false.
static void initFontSubst()
The QMap::iterator class provides an STL-style non-const iterator for QMap and QMultiMap.
The QTimerEvent class contains parameters that describe a timer event.
The QFont class specifies a font used for drawing text.
QExplicitlySharedDataPointer< QFontPrivate > d
void clear()
Clears the contents of the string and makes it empty.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QString family() const
Returns the requested font family name, i.e.
Q_GUI_EXPORT int qt_defaultDpi()
void setOverline(bool)
If enable is true, sets overline on; otherwise sets overline off.
float qt_mac_defaultDpi_x()
QFont::StyleHint styleHint() const
Returns the style of the matched window system font.
void setLocalData(T t)
Sets the local data for the calling thread to data.
bool exactMatch() const
Returns true if the matched window system font is exactly the same as the one specified by the font; ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
void setFixedPitch(bool)
If enable is true, sets fixed pitch on; otherwise sets fixed pitch off.
virtual QList< QScreen * > subScreens() const
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
QExplicitlySharedDataPointer< QFontPrivate > d
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
void detach()
Detaches the font object from common font data.
void setStyleName(const QString &)
Sets the style name of the font to the given styleName.
qreal pointSizeF() const
Returns the point size of the matched window system font.
void setWeight(int)
Sets the weight the font to weight, which should be a value from the QFont::Weight enumeration...
int height() const
Returns the height.
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
if(void) toggleToolbarShown
int weight() const
Returns the weight of the font which is one of the enumerated values from QFont::Weight.
const T & value() const
Returns the current item's value.
StyleStrategy
The style strategy tells the font matching algorithm what type of fonts should be used to find an app...
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
QMutex * qt_fontdatabase_mutex()
void increaseCost(uint cost)
bool operator!=(const QFont &) const
Returns true if this font is different from f; otherwise returns false.
void setPointSizeF(qreal)
Sets the point size to pointSize.
friend Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QFont &)
Writes the font font to the data stream s.
static QStringList substitutions()
Returns a sorted list of substituted family names.
iterator erase(iterator it)
Removes the (key, value) pair pointed to by the iterator pos from the map, and returns an iterator to...
bool rawMode() const
Returns true if the font is a raw mode font; otherwise returns false.
QString key() const
Returns the font's key, a textual representation of a font.
static const int fast_timeout
static qreal toDouble(const QChar *&str)
bool italic() const
Returns true if the style() of the font is not QFont::StyleNormal.
int pointSize() const
Returns the point size of the font.
The QSize class defines the size of a two-dimensional object using integer point precision.
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
QFontEngineData * findEngineData(const Key &key) const
The QDataStream class provides serialization of binary data to a QIODevice.
QFontEngine * findEngine(const Key &key)
bool exactMatch(const QFontDef &other) const
void setLetterSpacing(SpacingType type, qreal spacing)
Sets the letter spacing for the font to spacing and the type of spacing to type.
StyleStrategy styleStrategy() const
Returns the StyleStrategy.
bool rawMode() const
Returns true if raw mode is used for font name matching; otherwise returns false. ...
void setPixelSize(int)
Sets the font size to pixelSize pixels.
~QFontInfo()
Destroys the font info object.
bool strikeOut() const
Returns true if strikeout has been set; otherwise returns false.
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.
static const KeyPair *const end
void alterCharForCapitalization(QChar &c) const
QFontEngineData * engineData
StyleHint styleHint() const
Returns the StyleHint.
int physicalWidth() const
Returns the physical width of the screen in millimeters.
QHash< QString, QStringList > QFontSubst
The QThreadStorage class provides per-thread data storage.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void resolve(uint mask, const QFontPrivate *other)
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
void cleanupPrinterFonts()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static float pointSize(const QFontDef &fd, int dpi)
bool exactMatch() const
Returns true if a window system font exactly matching the settings of this font is available...
void setStyle(Style style)
Sets the style of the font to style.
Q_DECL_CONSTEXPR int qRound(qreal d)
void clear()
Removes all items from the map.
static Display * display()
Returns the default display for the application.
void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object...
int stretch() const
Returns the stretch factor for the font.
int screen() const
Returns the number of the screen currently in use.
The QList class is a template class that provides lists.
static void set_extended_font_bits(quint8 bits, QFontPrivate *f)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
qreal letterSpacing() const
Returns the letter spacing for the font.
int pointSize() const
Returns the point size of the matched window system font.
void killTimer(int id)
Kills the timer with timer identifier, id.
QString family() const
Returns the family name of the matched window system font.
bool overline() const
Returns the overline value of the matched window system font.
static int appDpiY(int screen=-1)
Returns the vertical resolution of the given screen in terms of the number of dots per inch...