source: trunk/doc/html/qfontinfo.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 10.1 KB
Line 
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"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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 &lt;<a href="qfontinfo-h.html">qfontinfo.h</a>&gt;</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&nbsp;QFont&nbsp;&amp;&nbsp;font )</li>
41<li class=fn><a href="#QFontInfo-2"><b>QFontInfo</b></a> ( const&nbsp;QFont&nbsp;&amp;&nbsp;font, QFont::Script&nbsp;script )</li>
42<li class=fn><a href="#QFontInfo-3"><b>QFontInfo</b></a> ( const&nbsp;QFontInfo&nbsp;&amp;&nbsp;fi )</li>
43<li class=fn><a href="#~QFontInfo"><b>~QFontInfo</b></a> ()</li>
44<li class=fn>QFontInfo &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QFontInfo&nbsp;&amp;&nbsp;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>,
63e.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
65values that were set, a QFontInfo object returns the values that
66apply 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
68machine 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
7124.
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
75info object for a screen-compatible font, i.e. the font cannot be
76a printer font<sup>*</sup>. If the font is changed later, the font
77info 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.
79This is equivalent to calling QFontInfo(widget->font()). If the
80widget's font is changed later, the font info object is <em>not</em>
81updated.
82<p> <li> <a href="qpainter.html#fontInfo">QPainter::fontInfo</a>() returns the font info for a painter's
83current font. If the painter's font is changed later, the font
84info object is <em>not</em> updated.
85</ol>
86<p> <sup>*</sup> If you use a printer font the values returned may be
87inaccurate. Printer fonts are not always accessible so the nearest
88screen 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&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;font )
93</h3>
94Constructs a font info object for <em>font</em>.
95<p> The font must be screen-compatible, i.e. a font you use when
96drawing 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
98passed in the constructor at the time it is created, and is not
99updated 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.
101This will give correct results also when painting on paint device
102that is not screen-compatible.
103
104<h3 class=fn><a name="QFontInfo-2"></a>QFontInfo::QFontInfo ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;font, <a href="qfont.html#Script-enum">QFont::Script</a>&nbsp;script )
105</h3>
106Constructs 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&nbsp;<a href="qfontinfo.html">QFontInfo</a>&nbsp;&amp;&nbsp;fi )
109</h3>
110Constructs a copy of <em>fi</em>.
111
112<h3 class=fn><a name="~QFontInfo"></a>QFontInfo::~QFontInfo ()
113</h3>
114Destroys 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>
125Returns TRUE if the matched window system font is exactly the same
126as 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>
131Returns 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>
137Returns 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>
142Returns 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>&nbsp;&amp; <a name="operator-eq"></a>QFontInfo::operator= ( const&nbsp;<a href="qfontinfo.html">QFontInfo</a>&nbsp;&amp;&nbsp;fi )
147</h3>
148Assigns the font info in <em>fi</em>.
149
150<h3 class=fn>int <a name="pixelSize"></a>QFontInfo::pixelSize () const
151</h3>
152Returns 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>
157Returns 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>
163Returns TRUE if the font is a raw mode font; otherwise returns
164FALSE.
165<p> If it is a raw mode font, all other functions in QFontInfo will
166return the same values set in the <a href="qfont.html">QFont</a>, regardless of the font
167actually 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>
172Returns 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>
178Returns 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>
183This file is part of the <a href="index.html">Qt toolkit</a>.
184Copyright &copy; 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 &copy; 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>
Note: See TracBrowser for help on using the repository browser.