7#include <QtCore/qcompare.h>
8#include <QtCore/qendian.h>
9#include <QtCore/qshareddata.h>
10#include <QtGui/qtguiglobal.h>
11#include <QtGui/qwindowdefs.h>
12#include <QtCore/qstring.h>
29 OldEnglish, Decorative = OldEnglish,
39 PreferDefault = 0x0001,
40 PreferBitmap = 0x0002,
41 PreferDevice = 0x0004,
42 PreferOutline = 0x0008,
43 ForceOutline = 0x0010,
45 PreferQuality = 0x0040,
46 PreferAntialias = 0x0080,
48 NoSubpixelAntialias = 0x0800,
49 PreferNoShaping = 0x1000,
50 ContextFontMerging = 0x2000,
51 NoFontMerging = 0x8000
56 PreferDefaultHinting = 0,
58 PreferVerticalHinting = 2,
113 NoPropertiesResolved = 0x0000,
114 FamilyResolved = 0x0001,
115 SizeResolved = 0x0002,
116 StyleHintResolved = 0x0004,
117 StyleStrategyResolved = 0x0008,
118 WeightResolved = 0x0010,
119 StyleResolved = 0x0020,
120 UnderlineResolved = 0x0040,
121 OverlineResolved = 0x0080,
122 StrikeOutResolved = 0x0100,
123 FixedPitchResolved = 0x0200,
124 StretchResolved = 0x0400,
125 KerningResolved = 0x0800,
126 CapitalizationResolved = 0x1000,
127 LetterSpacingResolved = 0x2000,
128 WordSpacingResolved = 0x4000,
129 HintingPreferenceResolved = 0x8000,
130 StyleNameResolved = 0x10000,
131 FamiliesResolved = 0x20000,
132 FeaturesResolved = 0x40000,
133 VariableAxesResolved = 0x80000,
134 AllPropertiesResolved = 0xfffff
140 QFont(
const QString &family,
int pointSize = -1,
int weight = -1,
bool italic =
false);
147 {
d.swap(
other.d); std::swap(resolve_mask,
other.resolve_mask); }
150 void setFamily(
const QString &);
156 void setStyleName(
const QString &);
158 int pointSize()
const;
159 void setPointSize(
int);
160 qreal pointSizeF()
const;
161 void setPointSizeF(
qreal);
163 int pixelSize()
const;
164 void setPixelSize(
int);
167 void setWeight(Weight
weight);
169 inline bool bold()
const;
170 inline void setBold(
bool);
175 inline bool italic()
const;
176 inline void setItalic(
bool b);
178 bool underline()
const;
179 void setUnderline(
bool);
181 bool overline()
const;
182 void setOverline(
bool);
184 bool strikeOut()
const;
185 void setStrikeOut(
bool);
187 bool fixedPitch()
const;
188 void setFixedPitch(
bool);
191 void setKerning(
bool);
193 StyleHint styleHint()
const;
194 StyleStrategy styleStrategy()
const;
195 void setStyleHint(StyleHint, StyleStrategy = PreferDefault);
196 void setStyleStrategy(StyleStrategy
s);
199 void setStretch(
int);
201 qreal letterSpacing()
const;
202 SpacingType letterSpacingType()
const;
205 qreal wordSpacing()
const;
208 void setCapitalization(Capitalization);
209 Capitalization capitalization()
const;
211 void setHintingPreference(HintingPreference hintingPreference);
212 HintingPreference hintingPreference()
const;
216 constexpr Tag() =
default;
223 static_assert(N == 5,
"The tag name must be exactly 4 characters long!");
226 constexpr bool isValid() const noexcept {
return m_value != 0; }
231 const char data[] = {
232 char((m_value & 0xff000000) >> 24),
233 char((m_value & 0x00ff0000) >> 16),
234 char((m_value & 0x0000ff00) >> 8),
235 char((m_value & 0x000000ff)) };
242 maybeTag.m_value =
value;
243 return maybeTag.isValid() ? std::optional<Tag>(maybeTag) : std::nullopt;
247#ifndef QT_NO_DATASTREAM
252#ifndef QT_NO_DEBUG_STREAM
261 {
return lhs.m_value == rhs.m_value; }
270 void unsetFeature(
Tag tag);
272 bool isFeatureSet(
Tag tag)
const;
273 QList<Tag> featureTags()
const;
274 void clearFeatures();
277 void unsetVariableAxis(
Tag tag);
278 bool isVariableAxisSet(
Tag tag)
const;
279 float variableAxisValue(
Tag tag)
const;
280 void clearVariableAxes();
281 QList<Tag> variableAxisTags()
const;
284 bool exactMatch()
const;
291 bool isCopyOf(
const QFont &)
const;
292 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(
QFont)
304 static void removeSubstitutions(
const QString &);
306 static void cleanup();
307 static void cacheStatistics();
315#if QT_DEPRECATED_SINCE(6, 0)
342 friend class QWin32PaintEngine;
347 friend class QPainterReplayer;
348 friend class QPaintBufferEngine;
352#ifndef QT_NO_DATASTREAM
357#ifndef QT_NO_DEBUG_STREAM
361 QExplicitlySharedDataPointer<QFontPrivate>
d;
365Q_DECLARE_SHARED(
QFont)
390#ifndef QT_NO_DATASTREAM
395#ifndef QT_NO_DEBUG_STREAM
The QApplication class manages the GUI application's control flow and main settings.
\inmodule QtCore\reentrant
\reentrant \inmodule QtGui
\reentrant \inmodule QtGui
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
void setStyle(Style style)
Sets the style of the font to style.
bool italic() const
Returns true if the style() of the font is not QFont::StyleNormal.
void swap(QFont &other) noexcept
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
void setItalic(bool b)
Sets the style() of the font to QFont::StyleItalic if enable is true; otherwise the style is set to Q...
void setResolveMask(uint mask)
Stretch
Predefined stretch values that follow the CSS naming convention.
Style style() const
Returns the style of the font.
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
Style
This enum describes the different styles of glyphs that are used to display text.
The QPainter class performs low-level painting on widgets and other paint devices.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\inmodule QtCore \title Classes and helpers for defining comparison operators \keyword qtcompare
Combined button and popup list for selecting options.
constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcept
#define Q_DECLARE_STRONGLY_ORDERED_LITERAL_TYPE(...)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
AudioChannelLayoutTag tag
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QFont &)
Q_GUI_EXPORT size_t qHash(const QFont &font, size_t seed=0) noexcept
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QFont &)
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint GLfloat weight
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
static const QQmlJSScope * resolve(const QQmlJSScope *current, const QStringList &names)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
#define QT_DEPRECATED_VERSION_X_6_0(text)
char * toString(const MyType &t)
[31]
The QFont::Tag type provides access to advanced font features.
QByteArray toString() const
Returns the string representation of this tag as a byte array.
constexpr Q_IMPLICIT Tag(const char(&str)[N]) noexcept
Constructs a tag from a string literal, str.
static constexpr std::optional< Tag > fromValue(quint32 value) noexcept
Returns a tag constructed from value, or std::nullopt if the tag produced would be invalid.
friend constexpr size_t qHash(Tag key, size_t seed=0) noexcept
Returns the hash value for key, using seed to seed the calculation.
constexpr Tag()=default
Default constructor, producing an invalid tag.
friend constexpr bool comparesEqual(const Tag &lhs, const Tag &rhs) noexcept
constexpr quint32 value() const noexcept
Returns the numerical value of this tag.
friend constexpr Qt::strong_ordering compareThreeWay(const Tag &lhs, const Tag &rhs) noexcept
Compare lhs with rhs for equality and ordering.
constexpr bool isValid() const noexcept
Returns whether the tag is valid.