~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qfontinfo.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/text/qfont.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QFontInfo Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QFontInfo Class Reference</h1>
 
21
<p>The QFontInfo class provides general information about fonts. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QFontInfo&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<ul>
 
24
<li><a href="qfontinfo-members.html">List of all members, including inherited members</a></li>
 
25
</ul>
 
26
<a name="public-functions"></a>
 
27
<h3>Public Functions</h3>
 
28
<ul>
 
29
<li><div class="fn"/><b><a href="qfontinfo.html#QFontInfo">QFontInfo</a></b> ( const QFont &amp; <i>font</i> )</li>
 
30
<li><div class="fn"/><b><a href="qfontinfo.html#QFontInfo-2">QFontInfo</a></b> ( const QFontInfo &amp; <i>fi</i> )</li>
 
31
<li><div class="fn"/><b><a href="qfontinfo.html#dtor.QFontInfo">~QFontInfo</a></b> ()</li>
 
32
<li><div class="fn"/>bool <b><a href="qfontinfo.html#bold">bold</a></b> () const</li>
 
33
<li><div class="fn"/>bool <b><a href="qfontinfo.html#exactMatch">exactMatch</a></b> () const</li>
 
34
<li><div class="fn"/>QString <b><a href="qfontinfo.html#family">family</a></b> () const</li>
 
35
<li><div class="fn"/>bool <b><a href="qfontinfo.html#fixedPitch">fixedPitch</a></b> () const</li>
 
36
<li><div class="fn"/>bool <b><a href="qfontinfo.html#italic">italic</a></b> () const</li>
 
37
<li><div class="fn"/>int <b><a href="qfontinfo.html#pixelSize">pixelSize</a></b> () const</li>
 
38
<li><div class="fn"/>int <b><a href="qfontinfo.html#pointSize">pointSize</a></b> () const</li>
 
39
<li><div class="fn"/>qreal <b><a href="qfontinfo.html#pointSizeF">pointSizeF</a></b> () const</li>
 
40
<li><div class="fn"/>bool <b><a href="qfontinfo.html#rawMode">rawMode</a></b> () const</li>
 
41
<li><div class="fn"/>QFont::Style <b><a href="qfontinfo.html#style">style</a></b> () const</li>
 
42
<li><div class="fn"/>QFont::StyleHint <b><a href="qfontinfo.html#styleHint">styleHint</a></b> () const</li>
 
43
<li><div class="fn"/>int <b><a href="qfontinfo.html#weight">weight</a></b> () const</li>
 
44
<li><div class="fn"/>QFontInfo &amp; <b><a href="qfontinfo.html#operator-eq">operator=</a></b> ( const QFontInfo &amp; <i>fi</i> )</li>
 
45
</ul>
 
46
<a name="details"></a>
 
47
<hr />
 
48
<h2>Detailed Description</h2>
 
49
<p>The QFontInfo class provides general information about fonts.</p>
 
50
<p>The QFontInfo class provides the same access functions as <a href="qfont.html">QFont</a>, e.g. <a href="qfontinfo.html#family">family</a>(), <a href="qfontinfo.html#pointSize">pointSize</a>(), <a href="qfontinfo.html#italic">italic</a>(), <a href="qfontinfo.html#weight">weight</a>(), <a href="qfontinfo.html#fixedPitch">fixedPitch</a>(), <a href="qfontinfo.html#styleHint">styleHint</a>() etc. But whilst the <a href="qfont.html">QFont</a> access functions return the values that were set, a QFontInfo object returns the values that apply to the font that will actually be used to draw the text.</p>
 
51
<p>For example, when the program asks for a 25pt Courier font on a machine that has a non-scalable 24pt Courier font, <a href="qfont.html">QFont</a> will (normally) use the 24pt Courier for rendering. In this case, <a href="qfont.html#pointSize">QFont::pointSize</a>() returns 25 and <a href="qfontinfo.html#pointSize">QFontInfo::pointSize</a>() returns 24.</p>
 
52
<p>There are three ways to create a QFontInfo object.</p>
 
53
<ol type="1">
 
54
<li>Calling the QFontInfo constructor with a <a href="qfont.html">QFont</a> creates a font info object for a screen-compatible font, i.e. the font cannot be a printer font. If the font is changed later, the font info object is <i>not</i> updated.<p>(Note: If you use a printer font the values returned may be inaccurate. Printer fonts are not always accessible so the nearest screen font is used if a printer font is supplied.)</p>
 
55
</li>
 
56
<li><a href="qwidget.html#fontInfo">QWidget::fontInfo</a>() returns the font info for a widget's font. This is equivalent to calling QFontInfo(widget-&gt;font()). If the widget's font is changed later, the font info object is <i>not</i> updated.</li>
 
57
<li><a href="qpainter.html#fontInfo">QPainter::fontInfo</a>() returns the font info for a painter's current font. If the painter's font is changed later, the font info object is <i>not</i> updated.</li>
 
58
</ol>
 
59
<p>See also <a href="qfont.html">QFont</a>, <a href="qfontmetrics.html">QFontMetrics</a>, and <a href="qfontdatabase.html">QFontDatabase</a>.</p>
 
60
<hr />
 
61
<h2>Member Function Documentation</h2>
 
62
<h3 class="fn"><a name="QFontInfo"></a>QFontInfo::QFontInfo ( const <a href="qfont.html">QFont</a> &amp; <i>font</i> )</h3>
 
63
<p>Constructs a font info object for <i>font</i>.</p>
 
64
<p>The font must be screen-compatible, i.e. a font you use when 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>.</p>
 
65
<p>The font info object holds the information for the font that is passed in the constructor at the time it is created, and is not updated if the font's attributes are changed later.</p>
 
66
<p>Use <a href="qpainter.html#fontInfo">QPainter::fontInfo</a>() to get the font info when painting. This will give correct results also when painting on paint device that is not screen-compatible.</p>
 
67
<h3 class="fn"><a name="QFontInfo-2"></a>QFontInfo::QFontInfo ( const QFontInfo &amp; <i>fi</i> )</h3>
 
68
<p>Constructs a copy of <i>fi</i>.</p>
 
69
<h3 class="fn"><a name="dtor.QFontInfo"></a>QFontInfo::~QFontInfo ()</h3>
 
70
<p>Destroys the font info object.</p>
 
71
<h3 class="fn"><a name="bold"></a>bool QFontInfo::bold () const</h3>
 
72
<p>Returns true if <a href="qfontinfo.html#weight">weight</a>() would return a value greater than <tt>QFont::Normal</tt>; otherwise returns false.</p>
 
73
<p>See also <a href="qfontinfo.html#weight">weight</a>() and <a href="qfont.html#bold">QFont::bold</a>().</p>
 
74
<h3 class="fn"><a name="exactMatch"></a>bool QFontInfo::exactMatch () const</h3>
 
75
<p>Returns true if the matched window system font is exactly the same as the one specified by the font; otherwise returns false.</p>
 
76
<p>See also <a href="qfont.html#exactMatch">QFont::exactMatch</a>().</p>
 
77
<h3 class="fn"><a name="family"></a><a href="qstring.html">QString</a> QFontInfo::family () const</h3>
 
78
<p>Returns the family name of the matched window system font.</p>
 
79
<p>See also <a href="qfont.html#family">QFont::family</a>().</p>
 
80
<h3 class="fn"><a name="fixedPitch"></a>bool QFontInfo::fixedPitch () const</h3>
 
81
<p>Returns the fixed pitch value of the matched window system font.</p>
 
82
<p>See also <a href="qfont.html#fixedPitch">QFont::fixedPitch</a>().</p>
 
83
<h3 class="fn"><a name="italic"></a>bool QFontInfo::italic () const</h3>
 
84
<p>Returns the italic value of the matched window system font.</p>
 
85
<p>See also <a href="qfont.html#italic">QFont::italic</a>().</p>
 
86
<h3 class="fn"><a name="pixelSize"></a>int QFontInfo::pixelSize () const</h3>
 
87
<p>Returns the pixel size of the matched window system font.</p>
 
88
<p>See also <a href="qfont.html#pointSize">QFont::pointSize</a>().</p>
 
89
<h3 class="fn"><a name="pointSize"></a>int QFontInfo::pointSize () const</h3>
 
90
<p>Returns the point size of the matched window system font.</p>
 
91
<p>See also <a href="qfontinfo.html#pointSizeF">pointSizeF</a>() and <a href="qfont.html#pointSize">QFont::pointSize</a>().</p>
 
92
<h3 class="fn"><a name="pointSizeF"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QFontInfo::pointSizeF () const</h3>
 
93
<p>Returns the point size of the matched window system font.</p>
 
94
<p>See also <a href="qfont.html#pointSizeF">QFont::pointSizeF</a>().</p>
 
95
<h3 class="fn"><a name="rawMode"></a>bool QFontInfo::rawMode () const</h3>
 
96
<p>Returns true if the font is a raw mode font; otherwise returns false.</p>
 
97
<p>If it is a raw mode font, all other functions in <a href="qfontinfo.html">QFontInfo</a> will return the same values set in the <a href="qfont.html">QFont</a>, regardless of the font actually used.</p>
 
98
<p>See also <a href="qfont.html#rawMode">QFont::rawMode</a>().</p>
 
99
<h3 class="fn"><a name="style"></a><a href="qfont.html#Style-enum">QFont::Style</a> QFontInfo::style () const</h3>
 
100
<p>Returns the style value of the matched window system font.</p>
 
101
<p>See also <a href="qfont.html#style">QFont::style</a>().</p>
 
102
<h3 class="fn"><a name="styleHint"></a><a href="qfont.html#StyleHint-enum">QFont::StyleHint</a> QFontInfo::styleHint () const</h3>
 
103
<p>Returns the style of the matched window system font.</p>
 
104
<p>Currently only returns the style hint set in <a href="qfont.html">QFont</a>.</p>
 
105
<p>See also <a href="qfont.html#styleHint">QFont::styleHint</a>() and <a href="qfont.html#StyleHint-enum">QFont::StyleHint</a>.</p>
 
106
<h3 class="fn"><a name="weight"></a>int QFontInfo::weight () const</h3>
 
107
<p>Returns the weight of the matched window system font.</p>
 
108
<p>See also <a href="qfont.html#weight">QFont::weight</a>() and <a href="qfontinfo.html#bold">bold</a>().</p>
 
109
<h3 class="fn"><a name="operator-eq"></a>QFontInfo &amp; QFontInfo::operator= ( const QFontInfo &amp; <i>fi</i> )</h3>
 
110
<p>Assigns the font info in <i>fi</i>.</p>
 
111
<p /><address><hr /><div align="center">
 
112
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
113
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
114
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
115
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
116
</tr></table></div></address></body>
 
117
</html>