You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/ntqfontinfo.html

192 lines
10 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qfont.cpp:2590 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQFontInfo Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQFontInfo Class Reference</h1>
<p>The TQFontInfo class provides general information about fonts.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qfontinfo-h.html">ntqfontinfo.h</a>&gt;</tt>
<p><a href="qfontinfo-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQFontInfo"><b>TQFontInfo</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;font )</li>
<li class=fn><a href="#TQFontInfo-2"><b>TQFontInfo</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;font, TQFont::Script&nbsp;script )</li>
<li class=fn><a href="#TQFontInfo-3"><b>TQFontInfo</b></a> ( const&nbsp;TQFontInfo&nbsp;&amp;&nbsp;fi )</li>
<li class=fn><a href="#~TQFontInfo"><b>~TQFontInfo</b></a> ()</li>
<li class=fn>TQFontInfo &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;TQFontInfo&nbsp;&amp;&nbsp;fi )</li>
<li class=fn>TQString <a href="#family"><b>family</b></a> () const</li>
<li class=fn>int <a href="#pixelSize"><b>pixelSize</b></a> () const</li>
<li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li>
<li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li>
<li class=fn>int <a href="#weight"><b>weight</b></a> () const</li>
<li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li>
<li class=fn>bool <a href="#fixedPitch"><b>fixedPitch</b></a> () const</li>
<li class=fn>TQFont::StyleHint <a href="#styleHint"><b>styleHint</b></a> () const</li>
<li class=fn>bool <a href="#rawMode"><b>rawMode</b></a> () const</li>
<li class=fn>bool <a href="#exactMatch"><b>exactMatch</b></a> () const</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
<p> The TQFontInfo class provides general information about fonts.
<p>
<p> The TQFontInfo class provides the same access functions as <a href="ntqfont.html">TQFont</a>,
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>(),
<a href="#styleHint">styleHint</a>() etc. But whilst the TQFont access functions return the
values that were set, a TQFontInfo object returns the values that
apply to the font that will actually be used to draw the text.
<p> For example, when the program asks for a 25pt Courier font on a
machine that has a non-scalable 24pt Courier font, TQFont will
(normally) use the 24pt Courier for rendering. In this case,
<a href="ntqfont.html#pointSize">TQFont::pointSize</a>() returns 25 and <a href="#pointSize">TQFontInfo::pointSize</a>() returns
24.
<p> There are three ways to create a TQFontInfo object.
<ol type=1>
<li> Calling the TQFontInfo constructor with a TQFont creates a font
info object for a screen-compatible font, i.e. the font cannot be
a printer font<sup>*</sup>. If the font is changed later, the font
info object is <em>not</em> updated.
<p> <li> <a href="ntqwidget.html#fontInfo">TQWidget::fontInfo</a>() returns the font info for a widget's font.
This is equivalent to calling TQFontInfo(widget->font()). If the
widget's font is changed later, the font info object is <em>not</em>
updated.
<p> <li> <a href="ntqpainter.html#fontInfo">TQPainter::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 <em>not</em> updated.
</ol>
<p> <sup>*</sup> 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> <p>See also <a href="ntqfont.html">TQFont</a>, <a href="ntqfontmetrics.html">TQFontMetrics</a>, <a href="ntqfontdatabase.html">TQFontDatabase</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQFontInfo"></a>TQFontInfo::TQFontInfo ( const&nbsp;<a href="ntqfont.html">TQFont</a>&nbsp;&amp;&nbsp;font )
</h3>
Constructs a font info object for <em>font</em>.
<p> The font must be screen-compatible, i.e. a font you use when
drawing text in <a href="ntqwidget.html">widgets</a> or <a href="ntqpixmap.html">pixmaps</a>, not <a href="ntqpicture.html">TQPicture</a> or <a href="ntqprinter.html">TQPrinter</a>.
<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> Use <a href="ntqpainter.html#fontInfo">TQPainter::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.
<h3 class=fn><a name="TQFontInfo-2"></a>TQFontInfo::TQFontInfo ( const&nbsp;<a href="ntqfont.html">TQFont</a>&nbsp;&amp;&nbsp;font, <a href="ntqfont.html#Script-enum">TQFont::Script</a>&nbsp;script )
</h3>
Constructs a font info object for <em>font</em> using the specified <em>script</em>.
<h3 class=fn><a name="TQFontInfo-3"></a>TQFontInfo::TQFontInfo ( const&nbsp;<a href="ntqfontinfo.html">TQFontInfo</a>&nbsp;&amp;&nbsp;fi )
</h3>
Constructs a copy of <em>fi</em>.
<h3 class=fn><a name="~TQFontInfo"></a>TQFontInfo::~TQFontInfo ()
</h3>
Destroys the font info object.
<h3 class=fn>bool <a name="bold"></a>TQFontInfo::bold () const
</h3>
<p> Returns TRUE if <a href="#weight">weight</a>() would return a value greater than <a href="ntqfont.html#Weight-enum">TQFont::Normal</a>; otherwise returns FALSE.
<p> <p>See also <a href="#weight">weight</a>() and <a href="ntqfont.html#bold">TQFont::bold</a>().
<p>Example: <a href="qfd-example.html#x1982">qfd/fontdisplayer.cpp</a>.
<h3 class=fn>bool <a name="exactMatch"></a>TQFontInfo::exactMatch () const
</h3>
Returns TRUE if the matched window system font is exactly the same
as the one specified by the font; otherwise returns FALSE.
<p> <p>See also <a href="ntqfont.html#exactMatch">TQFont::exactMatch</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="family"></a>TQFontInfo::family () const
</h3>
Returns the family name of the matched window system font.
<p> <p>See also <a href="ntqfont.html#family">TQFont::family</a>().
<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>.
<h3 class=fn>bool <a name="fixedPitch"></a>TQFontInfo::fixedPitch () const
</h3>
Returns the fixed pitch value of the matched window system font.
<p> <p>See also <a href="ntqfont.html#fixedPitch">TQFont::fixedPitch</a>().
<h3 class=fn>bool <a name="italic"></a>TQFontInfo::italic () const
</h3>
Returns the italic value of the matched window system font.
<p> <p>See also <a href="ntqfont.html#italic">TQFont::italic</a>().
<p>Example: <a href="qfd-example.html#x1984">qfd/fontdisplayer.cpp</a>.
<h3 class=fn><a href="ntqfontinfo.html">TQFontInfo</a>&nbsp;&amp; <a name="operator-eq"></a>TQFontInfo::operator= ( const&nbsp;<a href="ntqfontinfo.html">TQFontInfo</a>&nbsp;&amp;&nbsp;fi )
</h3>
Assigns the font info in <em>fi</em>.
<h3 class=fn>int <a name="pixelSize"></a>TQFontInfo::pixelSize () const
</h3>
Returns the pixel size of the matched window system font.
<p> <p>See also <a href="ntqfont.html#pointSize">TQFont::pointSize</a>().
<h3 class=fn>int <a name="pointSize"></a>TQFontInfo::pointSize () const
</h3>
Returns the point size of the matched window system font.
<p> <p>See also <a href="ntqfont.html#pointSize">TQFont::pointSize</a>().
<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>.
<h3 class=fn>bool <a name="rawMode"></a>TQFontInfo::rawMode () const
</h3>
Returns TRUE if the font is a raw mode font; otherwise returns
FALSE.
<p> If it is a raw mode font, all other functions in TQFontInfo will
return the same values set in the <a href="ntqfont.html">TQFont</a>, regardless of the font
actually used.
<p> <p>See also <a href="ntqfont.html#rawMode">TQFont::rawMode</a>().
<h3 class=fn><a href="ntqfont.html#StyleHint-enum">TQFont::StyleHint</a> <a name="styleHint"></a>TQFontInfo::styleHint () const
</h3>
Returns the style of the matched window system font.
<p> Currently only returns the style hint set in <a href="ntqfont.html">TQFont</a>.
<p> <p>See also <a href="ntqfont.html#styleHint">TQFont::styleHint</a>() and <a href="ntqfont.html#StyleHint-enum">TQFont::StyleHint</a>.
<h3 class=fn>int <a name="weight"></a>TQFontInfo::weight () const
</h3>
Returns the weight of the matched window system font.
<p> <p>See also <a href="ntqfont.html#weight">TQFont::weight</a>() and <a href="#bold">bold</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>