1QFontInfo(3qt)                                                  QFontInfo(3qt)
2
3
4

NAME

6       QFontInfo - General information about fonts
7

SYNOPSIS

9       #include <qfontinfo.h>
10
11   Public Members
12       QFontInfo ( const QFont & font )
13       QFontInfo ( const QFont & font, QFont::Script script )
14       QFontInfo ( const QFontInfo & fi )
15       ~QFontInfo ()
16       QFontInfo & operator= ( const QFontInfo & fi )
17       QString family () const
18       int pixelSize () const
19       int pointSize () const
20       bool italic () const
21       int weight () const
22       bool bold () const
23       bool fixedPitch () const
24       QFont::StyleHint styleHint () const
25       bool rawMode () const
26       bool exactMatch () const
27

DESCRIPTION

29       The QFontInfo class provides general information about fonts.
30
31       The QFontInfo class provides the same access functions as QFont, e.g.
32       family(), pointSize(), italic(), weight(), fixedPitch(), styleHint()
33       etc. But whilst the QFont access functions return the values that were
34       set, a QFontInfo object returns the values that apply to the font that
35       will actually be used to draw the text.
36
37       For example, when the program asks for a 25pt Courier font on a machine
38       that has a non-scalable 24pt Courier font, QFont will (normally) use
39       the 24pt Courier for rendering. In this case, QFont::pointSize()
40       returns 25 and QFontInfo::pointSize() returns 24.
41
42       There are three ways to create a QFontInfo object. <ol type=1>
43
44       1      Calling the QFontInfo constructor with a QFont creates a font
45              info object for a screen-compatible font, i.e. the font cannot
46              be a printer font<sup>*</sup>. If the font is changed later, the
47              font info object is not updated.
48
49       2      QWidget::fontInfo() returns the font info for a widget's font.
50              This is equivalent to calling QFontInfo(widget->font()). If the
51              widget's font is changed later, the font info object is not
52              updated.
53
54       3      QPainter::fontInfo() returns the font info for a painter's
55              current font. If the painter's font is changed later, the font
56              info object is not updated.
57
58       <sup>*</sup> If you use a printer font the values returned may be
59       inaccurate. Printer fonts are not always accessible so the nearest
60       screen font is used if a printer font is supplied.
61
62       See also QFont, QFontMetrics, QFontDatabase, Graphics Classes, and
63       Implicitly and Explicitly Shared Classes.
64

MEMBER FUNCTION DOCUMENTATION

QFontInfo::QFontInfo ( const QFont & font )

67       Constructs a font info object for font.
68
69       The font must be screen-compatible, i.e. a font you use when drawing
70       text in widgets or pixmaps, not QPicture or QPrinter.
71
72       The font info object holds the information for the font that is passed
73       in the constructor at the time it is created, and is not updated if the
74       font's attributes are changed later.
75
76       Use QPainter::fontInfo() to get the font info when painting. This will
77       give correct results also when painting on paint device that is not
78       screen-compatible.
79

QFontInfo::QFontInfo ( const QFont & font, QFont::Script script )

81       Constructs a font info object for font using the specified script.
82

QFontInfo::QFontInfo ( const QFontInfo & fi )

84       Constructs a copy of fi.
85

QFontInfo::~QFontInfo ()

87       Destroys the font info object.
88

bool QFontInfo::bold () const

90       Returns TRUE if weight() would return a value greater than
91       QFont::Normal; otherwise returns FALSE.
92
93       See also weight() and QFont::bold().
94
95       Example: qfd/fontdisplayer.cpp.
96

bool QFontInfo::exactMatch () const

98       Returns TRUE if the matched window system font is exactly the same as
99       the one specified by the font; otherwise returns FALSE.
100
101       See also QFont::exactMatch().
102

QString QFontInfo::family () const

104       Returns the family name of the matched window system font.
105
106       See also QFont::family().
107
108       Examples:
109

bool QFontInfo::fixedPitch () const

111       Returns the fixed pitch value of the matched window system font.
112
113       See also QFont::fixedPitch().
114

bool QFontInfo::italic () const

116       Returns the italic value of the matched window system font.
117
118       See also QFont::italic().
119
120       Example: qfd/fontdisplayer.cpp.
121

QFontInfo & QFontInfo::operator= ( const QFontInfo & fi )

123       Assigns the font info in fi.
124

int QFontInfo::pixelSize () const

126       Returns the pixel size of the matched window system font.
127
128       See also QFont::pointSize().
129

int QFontInfo::pointSize () const

131       Returns the point size of the matched window system font.
132
133       See also QFont::pointSize().
134
135       Examples:
136

bool QFontInfo::rawMode () const

138       Returns TRUE if the font is a raw mode font; otherwise returns FALSE.
139
140       If it is a raw mode font, all other functions in QFontInfo will return
141       the same values set in the QFont, regardless of the font actually used.
142
143       See also QFont::rawMode().
144

QFont::StyleHint QFontInfo::styleHint () const

146       Returns the style of the matched window system font.
147
148       Currently only returns the style hint set in QFont.
149
150       See also QFont::styleHint() and QFont::StyleHint.
151

int QFontInfo::weight () const

153       Returns the weight of the matched window system font.
154
155       See also QFont::weight() and bold().
156
157

SEE ALSO

159       http://doc.trolltech.com/qfontinfo.html
160       http://www.trolltech.com/faq/tech.html
161
163       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
164       license file included in the distribution for a complete license
165       statement.
166

AUTHOR

168       Generated automatically from the source code.
169

BUGS

171       If you find a bug in Qt, please report it as described in
172       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
173       help you. Thank you.
174
175       The definitive Qt documentation is provided in HTML format; it is
176       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
177       web browser. This man page is provided as a convenience for those users
178       who prefer man pages, although this format is not officially supported
179       by Trolltech.
180
181       If you find errors in this manual page, please report them to qt-
182       bugs@trolltech.com.  Please include the name of the manual page
183       (qfontinfo.3qt) and the Qt version (3.3.8).
184
185
186
187Trolltech AS                    2 February 2007                 QFontInfo(3qt)
Impressum