45 #include <QtGui/qwindowdefs.h> 46 #include <QtCore/qstring.h> 47 #include <QtCore/qsharedpointer.h> 49 #if defined(Q_WS_X11) || defined(Q_WS_QWS) 62 class Q3TextFormatCollection;
70 Helvetica, SansSerif = Helvetica,
72 Courier, TypeWriter = Courier,
82 PreferDefault = 0x0001,
83 PreferBitmap = 0x0002,
84 PreferDevice = 0x0004,
85 PreferOutline = 0x0008,
86 ForceOutline = 0x0010,
88 PreferQuality = 0x0040,
89 PreferAntialias = 0x0080,
91 OpenGLCompatible = 0x0200,
92 ForceIntegerMetrics = 0x0400,
93 NoFontMerging = 0x8000
97 PreferDefaultHinting = 0,
99 PreferVerticalHinting = 2,
100 PreferFullHinting = 3
143 FamilyResolved = 0x0001,
144 SizeResolved = 0x0002,
145 StyleHintResolved = 0x0004,
146 StyleStrategyResolved = 0x0008,
147 WeightResolved = 0x0010,
148 StyleResolved = 0x0020,
149 UnderlineResolved = 0x0040,
150 OverlineResolved = 0x0080,
151 StrikeOutResolved = 0x0100,
152 FixedPitchResolved = 0x0200,
153 StretchResolved = 0x0400,
154 KerningResolved = 0x0800,
155 CapitalizationResolved = 0x1000,
156 LetterSpacingResolved = 0x2000,
157 WordSpacingResolved = 0x4000,
158 HintingPreferenceResolved = 0x8000,
159 StyleNameResolved = 0x10000,
160 AllPropertiesResolved = 0x1ffff
170 void setFamily(
const QString &);
173 void setStyleName(
const QString &);
176 void setPointSize(
int);
177 qreal pointSizeF()
const;
178 void setPointSizeF(
qreal);
181 void setPixelSize(
int);
186 inline bool bold()
const;
187 inline void setBold(
bool);
189 void setStyle(
Style style);
192 inline bool italic()
const;
193 inline void setItalic(
bool b);
195 bool underline()
const;
196 void setUnderline(
bool);
198 bool overline()
const;
199 void setOverline(
bool);
201 bool strikeOut()
const;
202 void setStrikeOut(
bool);
204 bool fixedPitch()
const;
205 void setFixedPitch(
bool);
208 void setKerning(
bool);
216 void setStretch(
int);
218 qreal letterSpacing()
const;
222 qreal wordSpacing()
const;
223 void setWordSpacing(
qreal spacing);
232 bool rawMode()
const;
233 void setRawMode(
bool);
236 bool exactMatch()
const;
243 bool isCopyOf(
const QFont &)
const;
244 #ifdef Q_COMPILER_RVALUE_REFS 246 {
qSwap(
d, other.d);
qSwap(resolve_mask, other.resolve_mask);
return *
this; }
250 HFONT handle()
const;
257 #if defined(Q_WS_X11) || defined(Q_WS_QWS) 262 void setRawName(
const QString &);
268 bool fromString(
const QString &);
275 static void removeSubstitution(
const QString &);
276 static void initialize();
279 static void cacheStatistics();
283 QString lastResortFamily()
const;
284 QString lastResortFont()
const;
291 static QT3_SUPPORT
QFont defaultFont();
292 static QT3_SUPPORT
void setDefaultFont(
const QFont &);
293 QT3_SUPPORT
void setPixelSizeFloat(
qreal);
294 QT3_SUPPORT
qreal pointSizeFloat()
const {
return pointSizeF(); }
295 QT3_SUPPORT
void setPointSizeFloat(
qreal size) { setPointSizeF(size); }
303 #if defined(Q_WS_MAC) 305 #elif defined(Q_WS_X11) 306 void x11SetScreen(
int screen = -1);
307 int x11Screen()
const;
317 friend class QPSPrintEngineFont;
321 friend class Q3TextFormatCollection;
328 friend class QWin32PaintEngine;
338 #ifndef QT_NO_DATASTREAM 349 {
return weight() > Normal; }
353 { setWeight(enable ? Bold : Normal); }
357 return (style() != StyleNormal);
361 setStyle(b ? StyleItalic : StyleNormal);
369 #ifndef QT_NO_DATASTREAM 374 #ifndef QT_NO_DEBUG_STREAM
The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
The QDebug class provides an output stream for debugging information.
The QApplication class manages the GUI application's control flow and main settings.
HintingPreference
This enum describes the different levels of hinting that can be applied to glyphs to improve legibili...
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QTextLine class represents a line of text inside a QTextLayout.
Weight
Qt uses a weighting scale from 0 to 99 similar to, but not the same as, the scales used in Windows or...
bool operator!=(QBool b1, bool b2)
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...
Stretch
Predefined stretch values that follow the CSS naming convention.
Capitalization
Rendering option for text this font applies to.
bool operator<(int priority, const QPair< QRunnable *, int > &p)
static QString toString(Register *reg, int type, bool *ok=0)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
struct FT_FaceRec_ * FT_Face
static float pixelSize(const QFontDef &request, int dpi)
The QGLContext class encapsulates an OpenGL rendering context.
ResolveProperties
This enum describes the properties of a QFont that can be set on a font individually and then conside...
The QStringList class provides a list of strings.
const char * styleHint(const QFontDef &request)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QFont &)
The QFontInfo class provides general information about fonts.
Style
This enum describes the different styles of glyphs that are used to display text. ...
void qSwap(T &value1, T &value2)
bool bold() const
Returns true if weight() is a value greater than QFont::Normal ; otherwise returns false...
The QTextLayout class is used to lay out and render text.
StyleHint
Style hints are used by the font matching algorithm to find an appropriate default family if a select...
The QFont class specifies a font used for drawing text.
QExplicitlySharedDataPointer< QFontPrivate > d
StyleStrategy
The style strategy tells the font matching algorithm what type of fonts should be used to find an app...
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QFont &)
bool italic() const
Returns true if the style() of the font is not QFont::StyleNormal.
The QFontMetricsF class provides font metrics information.
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
The QDataStream class provides serialization of binary data to a QIODevice.
bool operator==(QBool b1, bool b2)
static float pointSize(const QFontDef &fd, int dpi)