[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qfont.cpp:2590 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QFontInfo Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QFontInfo Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QFontInfo class provides general information about fonts.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qfontinfo-h.html">qfontinfo.h</a>></tt>
|
---|
| 37 | <p><a href="qfontinfo-members.html">List of all member functions.</a>
|
---|
| 38 | <h2>Public Members</h2>
|
---|
| 39 | <ul>
|
---|
| 40 | <li class=fn><a href="#QFontInfo"><b>QFontInfo</b></a> ( const QFont & font )</li>
|
---|
| 41 | <li class=fn><a href="#QFontInfo-2"><b>QFontInfo</b></a> ( const QFont & font, QFont::Script script )</li>
|
---|
| 42 | <li class=fn><a href="#QFontInfo-3"><b>QFontInfo</b></a> ( const QFontInfo & fi )</li>
|
---|
| 43 | <li class=fn><a href="#~QFontInfo"><b>~QFontInfo</b></a> ()</li>
|
---|
| 44 | <li class=fn>QFontInfo & <a href="#operator-eq"><b>operator=</b></a> ( const QFontInfo & fi )</li>
|
---|
| 45 | <li class=fn>QString <a href="#family"><b>family</b></a> () const</li>
|
---|
| 46 | <li class=fn>int <a href="#pixelSize"><b>pixelSize</b></a> () const</li>
|
---|
| 47 | <li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li>
|
---|
| 48 | <li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li>
|
---|
| 49 | <li class=fn>int <a href="#weight"><b>weight</b></a> () const</li>
|
---|
| 50 | <li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li>
|
---|
| 51 | <li class=fn>bool <a href="#fixedPitch"><b>fixedPitch</b></a> () const</li>
|
---|
| 52 | <li class=fn>QFont::StyleHint <a href="#styleHint"><b>styleHint</b></a> () const</li>
|
---|
| 53 | <li class=fn>bool <a href="#rawMode"><b>rawMode</b></a> () const</li>
|
---|
| 54 | <li class=fn>bool <a href="#exactMatch"><b>exactMatch</b></a> () const</li>
|
---|
| 55 | </ul>
|
---|
| 56 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | <p> The QFontInfo class provides general information about fonts.
|
---|
| 60 | <p>
|
---|
| 61 |
|
---|
| 62 | <p> The QFontInfo class provides the same access functions as <a href="qfont.html">QFont</a>,
|
---|
| 63 | e.g. <a href="#family">family</a>(), <a href="#pointSize">pointSize</a>(), <a href="#italic">italic</a>(), <a href="#weight">weight</a>(), <a href="#fixedPitch">fixedPitch</a>(),
|
---|
| 64 | <a href="#styleHint">styleHint</a>() etc. But whilst the QFont access functions return the
|
---|
| 65 | values that were set, a QFontInfo object returns the values that
|
---|
| 66 | apply to the font that will actually be used to draw the text.
|
---|
| 67 | <p> For example, when the program asks for a 25pt Courier font on a
|
---|
| 68 | machine that has a non-scalable 24pt Courier font, QFont will
|
---|
| 69 | (normally) use the 24pt Courier for rendering. In this case,
|
---|
| 70 | <a href="qfont.html#pointSize">QFont::pointSize</a>() returns 25 and <a href="#pointSize">QFontInfo::pointSize</a>() returns
|
---|
| 71 | 24.
|
---|
| 72 | <p> There are three ways to create a QFontInfo object.
|
---|
| 73 | <ol type=1>
|
---|
| 74 | <li> Calling the QFontInfo constructor with a QFont creates a font
|
---|
| 75 | info object for a screen-compatible font, i.e. the font cannot be
|
---|
| 76 | a printer font<sup>*</sup>. If the font is changed later, the font
|
---|
| 77 | info object is <em>not</em> updated.
|
---|
| 78 | <p> <li> <a href="qwidget.html#fontInfo">QWidget::fontInfo</a>() returns the font info for a widget's font.
|
---|
| 79 | This is equivalent to calling QFontInfo(widget->font()). If the
|
---|
| 80 | widget's font is changed later, the font info object is <em>not</em>
|
---|
| 81 | updated.
|
---|
| 82 | <p> <li> <a href="qpainter.html#fontInfo">QPainter::fontInfo</a>() returns the font info for a painter's
|
---|
| 83 | current font. If the painter's font is changed later, the font
|
---|
| 84 | info object is <em>not</em> updated.
|
---|
| 85 | </ol>
|
---|
| 86 | <p> <sup>*</sup> If you use a printer font the values returned may be
|
---|
| 87 | inaccurate. Printer fonts are not always accessible so the nearest
|
---|
| 88 | screen font is used if a printer font is supplied.
|
---|
| 89 | <p> <p>See also <a href="qfont.html">QFont</a>, <a href="qfontmetrics.html">QFontMetrics</a>, <a href="qfontdatabase.html">QFontDatabase</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.
|
---|
| 90 |
|
---|
| 91 | <hr><h2>Member Function Documentation</h2>
|
---|
| 92 | <h3 class=fn><a name="QFontInfo"></a>QFontInfo::QFontInfo ( const <a href="qfont.html">QFont</a> & font )
|
---|
| 93 | </h3>
|
---|
| 94 | Constructs a font info object for <em>font</em>.
|
---|
| 95 | <p> The font must be screen-compatible, i.e. a font you use when
|
---|
| 96 | drawing text in <a href="qwidget.html">widgets</a> or <a href="qpixmap.html">pixmaps</a>, not <a href="qpicture.html">QPicture</a> or <a href="qprinter.html">QPrinter</a>.
|
---|
| 97 | <p> The font info object holds the information for the font that is
|
---|
| 98 | passed in the constructor at the time it is created, and is not
|
---|
| 99 | updated if the font's attributes are changed later.
|
---|
| 100 | <p> Use <a href="qpainter.html#fontInfo">QPainter::fontInfo</a>() to get the font info when painting.
|
---|
| 101 | This will give correct results also when painting on paint device
|
---|
| 102 | that is not screen-compatible.
|
---|
| 103 |
|
---|
| 104 | <h3 class=fn><a name="QFontInfo-2"></a>QFontInfo::QFontInfo ( const <a href="qfont.html">QFont</a> & font, <a href="qfont.html#Script-enum">QFont::Script</a> script )
|
---|
| 105 | </h3>
|
---|
| 106 | Constructs a font info object for <em>font</em> using the specified <em>script</em>.
|
---|
| 107 |
|
---|
| 108 | <h3 class=fn><a name="QFontInfo-3"></a>QFontInfo::QFontInfo ( const <a href="qfontinfo.html">QFontInfo</a> & fi )
|
---|
| 109 | </h3>
|
---|
| 110 | Constructs a copy of <em>fi</em>.
|
---|
| 111 |
|
---|
| 112 | <h3 class=fn><a name="~QFontInfo"></a>QFontInfo::~QFontInfo ()
|
---|
| 113 | </h3>
|
---|
| 114 | Destroys the font info object.
|
---|
| 115 |
|
---|
| 116 | <h3 class=fn>bool <a name="bold"></a>QFontInfo::bold () const
|
---|
| 117 | </h3>
|
---|
| 118 |
|
---|
| 119 | <p> Returns TRUE if <a href="#weight">weight</a>() would return a value greater than <a href="qfont.html#Weight-enum">QFont::Normal</a>; otherwise returns FALSE.
|
---|
| 120 | <p> <p>See also <a href="#weight">weight</a>() and <a href="qfont.html#bold">QFont::bold</a>().
|
---|
| 121 |
|
---|
| 122 | <p>Example: <a href="qfd-example.html#x1982">qfd/fontdisplayer.cpp</a>.
|
---|
| 123 | <h3 class=fn>bool <a name="exactMatch"></a>QFontInfo::exactMatch () const
|
---|
| 124 | </h3>
|
---|
| 125 | Returns TRUE if the matched window system font is exactly the same
|
---|
| 126 | as the one specified by the font; otherwise returns FALSE.
|
---|
| 127 | <p> <p>See also <a href="qfont.html#exactMatch">QFont::exactMatch</a>().
|
---|
| 128 |
|
---|
| 129 | <h3 class=fn><a href="qstring.html">QString</a> <a name="family"></a>QFontInfo::family () const
|
---|
| 130 | </h3>
|
---|
| 131 | Returns the family name of the matched window system font.
|
---|
| 132 | <p> <p>See also <a href="qfont.html#family">QFont::family</a>().
|
---|
| 133 |
|
---|
| 134 | <p>Examples: <a href="simple-font-demo-example.html#x2848">fonts/simple-qfont-demo/viewer.cpp</a> and <a href="qfd-example.html#x1983">qfd/fontdisplayer.cpp</a>.
|
---|
| 135 | <h3 class=fn>bool <a name="fixedPitch"></a>QFontInfo::fixedPitch () const
|
---|
| 136 | </h3>
|
---|
| 137 | Returns the fixed pitch value of the matched window system font.
|
---|
| 138 | <p> <p>See also <a href="qfont.html#fixedPitch">QFont::fixedPitch</a>().
|
---|
| 139 |
|
---|
| 140 | <h3 class=fn>bool <a name="italic"></a>QFontInfo::italic () const
|
---|
| 141 | </h3>
|
---|
| 142 | Returns the italic value of the matched window system font.
|
---|
| 143 | <p> <p>See also <a href="qfont.html#italic">QFont::italic</a>().
|
---|
| 144 |
|
---|
| 145 | <p>Example: <a href="qfd-example.html#x1984">qfd/fontdisplayer.cpp</a>.
|
---|
| 146 | <h3 class=fn><a href="qfontinfo.html">QFontInfo</a> & <a name="operator-eq"></a>QFontInfo::operator= ( const <a href="qfontinfo.html">QFontInfo</a> & fi )
|
---|
| 147 | </h3>
|
---|
| 148 | Assigns the font info in <em>fi</em>.
|
---|
| 149 |
|
---|
| 150 | <h3 class=fn>int <a name="pixelSize"></a>QFontInfo::pixelSize () const
|
---|
| 151 | </h3>
|
---|
| 152 | Returns the pixel size of the matched window system font.
|
---|
| 153 | <p> <p>See also <a href="qfont.html#pointSize">QFont::pointSize</a>().
|
---|
| 154 |
|
---|
| 155 | <h3 class=fn>int <a name="pointSize"></a>QFontInfo::pointSize () const
|
---|
| 156 | </h3>
|
---|
| 157 | Returns the point size of the matched window system font.
|
---|
| 158 | <p> <p>See also <a href="qfont.html#pointSize">QFont::pointSize</a>().
|
---|
| 159 |
|
---|
| 160 | <p>Examples: <a href="simple-font-demo-example.html#x2849">fonts/simple-qfont-demo/viewer.cpp</a> and <a href="qfd-example.html#x1985">qfd/fontdisplayer.cpp</a>.
|
---|
| 161 | <h3 class=fn>bool <a name="rawMode"></a>QFontInfo::rawMode () const
|
---|
| 162 | </h3>
|
---|
| 163 | Returns TRUE if the font is a raw mode font; otherwise returns
|
---|
| 164 | FALSE.
|
---|
| 165 | <p> If it is a raw mode font, all other functions in QFontInfo will
|
---|
| 166 | return the same values set in the <a href="qfont.html">QFont</a>, regardless of the font
|
---|
| 167 | actually used.
|
---|
| 168 | <p> <p>See also <a href="qfont.html#rawMode">QFont::rawMode</a>().
|
---|
| 169 |
|
---|
| 170 | <h3 class=fn><a href="qfont.html#StyleHint-enum">QFont::StyleHint</a> <a name="styleHint"></a>QFontInfo::styleHint () const
|
---|
| 171 | </h3>
|
---|
| 172 | Returns the style of the matched window system font.
|
---|
| 173 | <p> Currently only returns the style hint set in <a href="qfont.html">QFont</a>.
|
---|
| 174 | <p> <p>See also <a href="qfont.html#styleHint">QFont::styleHint</a>() and <a href="qfont.html#StyleHint-enum">QFont::StyleHint</a>.
|
---|
| 175 |
|
---|
| 176 | <h3 class=fn>int <a name="weight"></a>QFontInfo::weight () const
|
---|
| 177 | </h3>
|
---|
| 178 | Returns the weight of the matched window system font.
|
---|
| 179 | <p> <p>See also <a href="qfont.html#weight">QFont::weight</a>() and <a href="#bold">bold</a>().
|
---|
| 180 |
|
---|
| 181 | <!-- eof -->
|
---|
| 182 | <hr><p>
|
---|
| 183 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 184 | Copyright © 1995-2007
|
---|
| 185 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 186 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 187 | <td>Copyright © 2007
|
---|
| 188 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 189 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 190 | </table></div></address></body>
|
---|
| 191 | </html>
|
---|