Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1139

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QFont Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QFont Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QFont class specifies a font used for drawing text. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qfont.html#Capitalization-enum">Capitalization</a></b> { MixedCase, AllUppercase, AllLowercase, SmallCaps, Capitalize }</li><li><div class="fn" />enum <b><a href="qfont.html#SpacingType-enum">SpacingType</a></b> { PercentageSpacing, AbsoluteSpacing }</li><li><div class="fn" />enum <b><a href="qfont.html#Stretch-enum">Stretch</a></b> { UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, ..., UltraExpanded }</li><li><div class="fn" />enum <b><a href="qfont.html#Style-enum">Style</a></b> { StyleNormal, StyleItalic, StyleOblique }</li><li><div class="fn" />enum <b><a href="qfont.html#StyleHint-enum">StyleHint</a></b> { Helvetica, SansSerif, Times, Serif, ..., AnyStyle }</li><li><div class="fn" />enum <b><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a></b> { PreferDefault, PreferBitmap, PreferDevice, PreferOutline, ..., NoFontMerging }</li><li><div class="fn" />enum <b><a href="qfont.html#Weight-enum">Weight</a></b> { Light, Normal, DemiBold, Bold, Black }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qfont.html#QFont">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qfont.html#QFont-2">__init__</a></b> (<i>self</i>, QString, int&#160;<i>pointSize</i>&#160;=&#160;-1, int&#160;<i>weight</i>&#160;=&#160;-1, bool&#160;<i>italic</i>&#160;=&#160;False)</li><li><div class="fn" /><b><a href="qfont.html#QFont-3">__init__</a></b> (<i>self</i>, QFont, QPaintDevice)</li><li><div class="fn" /><b><a href="qfont.html#QFont-4">__init__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qfont.html#QFont-5">__init__</a></b> (<i>self</i>, QVariant&#160;<i>variant</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#bold">bold</a></b> (<i>self</i>)</li><li><div class="fn" />Capitalization <b><a href="qfont.html#capitalization">capitalization</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#defaultFamily">defaultFamily</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#exactMatch">exactMatch</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#family">family</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#fixedPitch">fixedPitch</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#fromString">fromString</a></b> (<i>self</i>, QString)</li><li><div class="fn" />int <b><a href="qfont.html#handle">handle</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#isCopyOf">isCopyOf</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#italic">italic</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#kerning">kerning</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#key">key</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#lastResortFamily">lastResortFamily</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#lastResortFont">lastResortFont</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#letterSpacing">letterSpacing</a></b> (<i>self</i>)</li><li><div class="fn" />SpacingType <b><a href="qfont.html#letterSpacingType">letterSpacingType</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#overline">overline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#pixelSize">pixelSize</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#pointSize">pointSize</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#pointSizeF">pointSizeF</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#rawMode">rawMode</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#rawName">rawName</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qfont.html#resolve">resolve</a></b> (<i>self</i>, QFont)</li><li><div class="fn" /><b><a href="qfont.html#setBold">setBold</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setCapitalization">setCapitalization</a></b> (<i>self</i>, Capitalization)</li><li><div class="fn" /><b><a href="qfont.html#setFamily">setFamily</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qfont.html#setFixedPitch">setFixedPitch</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setItalic">setItalic</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setKerning">setKerning</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setLetterSpacing">setLetterSpacing</a></b> (<i>self</i>, SpacingType, float)</li><li><div class="fn" /><b><a href="qfont.html#setOverline">setOverline</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setPixelSize">setPixelSize</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setPointSize">setPointSize</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setPointSizeF">setPointSizeF</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qfont.html#setRawMode">setRawMode</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setRawName">setRawName</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qfont.html#setStretch">setStretch</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setStrikeOut">setStrikeOut</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setStyle">setStyle</a></b> (<i>self</i>, Style)</li><li><div class="fn" /><b><a href="qfont.html#setStyleHint">setStyleHint</a></b> (<i>self</i>, StyleHint, StyleStrategy&#160;<i>strategy</i>&#160;=&#160;QFont.PreferDefault)</li><li><div class="fn" /><b><a href="qfont.html#setStyleStrategy">setStyleStrategy</a></b> (<i>self</i>, StyleStrategy)</li><li><div class="fn" /><b><a href="qfont.html#setUnderline">setUnderline</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qfont.html#setWeight">setWeight</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qfont.html#setWordSpacing">setWordSpacing</a></b> (<i>self</i>, float)</li><li><div class="fn" />int <b><a href="qfont.html#stretch">stretch</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#strikeOut">strikeOut</a></b> (<i>self</i>)</li><li><div class="fn" />Style <b><a href="qfont.html#style">style</a></b> (<i>self</i>)</li><li><div class="fn" />StyleHint <b><a href="qfont.html#styleHint">styleHint</a></b> (<i>self</i>)</li><li><div class="fn" />StyleStrategy <b><a href="qfont.html#styleStrategy">styleStrategy</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qfont.html#toString">toString</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfont.html#underline">underline</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qfont.html#weight">weight</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qfont.html#wordSpacing">wordSpacing</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" /><b><a href="qfont.html#cacheStatistics">cacheStatistics</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#cleanup">cleanup</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#initialize">initialize</a></b> ()</li><li><div class="fn" /><b><a href="qfont.html#insertSubstitution">insertSubstitution</a></b> (QString, QString)</li><li><div class="fn" /><b><a href="qfont.html#insertSubstitutions">insertSubstitutions</a></b> (QString, QStringList)</li><li><div class="fn" /><b><a href="qfont.html#removeSubstitution">removeSubstitution</a></b> (QString)</li><li><div class="fn" />QString <b><a href="qfont.html#substitute">substitute</a></b> (QString)</li><li><div class="fn" />QStringList <b><a href="qfont.html#substitutes">substitutes</a></b> (QString)</li><li><div class="fn" />QStringList <b><a href="qfont.html#substitutions">substitutions</a></b> ()</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qfont.html#__eq__">__eq__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__ge__">__ge__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__lt__">__lt__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />bool <b><a href="qfont.html#__ne__">__ne__</a></b> (<i>self</i>, QFont)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QFont class specifies a font used for drawing text.</p>
<p>When you create a QFont object you specify various attributes that you want the font to have. Qt will use the font with the specified attributes, or if no matching font exists, Qt will use the closest matching installed font. The attributes of the font that is actually used are retrievable from a <a href="qfontinfo.html">QFontInfo</a> object. If the window system provides an exact match <a href="qfont.html#exactMatch">exactMatch</a>() returns true. Use <a href="qfontmetrics.html">QFontMetrics</a> to get measurements, e.g. the pixel length of a string using <a href="qfontmetrics.html#width">QFontMetrics.width</a>().</p>
<p>Note that a <a href="qapplication.html">QApplication</a> instance must exist before a QFont can be used. You can set the application's default font with <a href="qapplication.html#setFont">QApplication.setFont</a>().</p>
<p>If a chosen font does not include all the characters that need to be displayed, QFont will try to find the characters in the nearest equivalent fonts. When a <a href="qpainter.html">QPainter</a> draws a character from a font the QFont will report whether or not it has the character; if it does not, <a href="qpainter.html">QPainter</a> will draw an unfilled square.</p>
<p>Create QFonts like this:</p>
<pre> QFont serifFont("Times", 10, QFont.Bold);
 QFont sansFont("Helvetica [Cronyx]", 12);</pre>
<p>The attributes set in the constructor can also be set later, e.g. <a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), <a class="compat" href="qfont-qt3.html#setPointSizeFloat">setPointSizeFloat</a>(), <a href="qfont.html#setWeight">setWeight</a>() and <a href="qfont.html#setItalic">setItalic</a>(). The remaining attributes must be set after contstruction, e.g. <a href="qfont.html#setBold">setBold</a>(), <a href="qfont.html#setUnderline">setUnderline</a>(), <a href="qfont.html#setOverline">setOverline</a>(), <a href="qfont.html#setStrikeOut">setStrikeOut</a>() and <a href="qfont.html#setFixedPitch">setFixedPitch</a>(). <a href="qfontinfo.html">QFontInfo</a> objects should be created <i>after</i> the font's attributes have been set. A <a href="qfontinfo.html">QFontInfo</a> object will not change, even if you change the font's attributes. The corresponding "get" functions, e.g. <a href="qfont.html#family">family</a>(), <a href="qfont.html#pointSize">pointSize</a>(), etc., return the values that were set, even though the values used may differ. The actual values are available from a <a href="qfontinfo.html">QFontInfo</a> object.</p>
<p>If the requested font family is unavailable you can influence the <a href="#fontmatching">font matching algorithm</a> by choosing a particular <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a> and <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a> with <a href="qfont.html#setStyleHint">setStyleHint</a>(). The default family (corresponding to the current style hint) is returned by <a href="qfont.html#defaultFamily">defaultFamily</a>().</p>
<p>The font-matching algorithm has a <a href="qfont.html#lastResortFamily">lastResortFamily</a>() and <a href="qfont.html#lastResortFont">lastResortFont</a>() in cases where a suitable match cannot be found. You can provide substitutions for font family names using <a href="qfont.html#insertSubstitution">insertSubstitution</a>() and <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(). Substitutions can be removed with <a href="qfont.html#removeSubstitution">removeSubstitution</a>(). Use <a href="qfont.html#substitute">substitute</a>() to retrieve a family's first substitute, or the family name itself if it has no substitutes. Use <a href="qfont.html#substitutes">substitutes</a>() to retrieve a list of a family's substitutes (which may be empty).</p>
<p>Every QFont has a <a href="qfont.html#key">key</a>() which you can use, for example, as the key in a cache or dictionary. If you want to store a user's font preferences you could use <a href="qsettings.html">QSettings</a>, writing the font information with <a href="qfont.html#toString">toString</a>() and reading it back with <a href="qfont.html#fromString">fromString</a>(). The operator&lt;&lt;() and operator&gt;&gt;() functions are also available, but they work on a data stream.</p>
<p>It is possible to set the height of characters shown on the screen to a specified number of pixels with <a href="qfont.html#setPixelSize">setPixelSize</a>(); however using <a href="qfont.html#setPointSize">setPointSize</a>() has a similar effect and provides device independence.</p>
<p>In X11 you can set a font using its system specific name with <a href="qfont.html#setRawName">setRawName</a>().</p>
<p>Loading fonts can be expensive, especially on X11. QFont contains extensive optimizations to make the copying of QFont objects fast, and to cache the results of the slow window system functions it depends upon.</p>
<a name="fontmatching" /><p>The font matching algorithm works as follows:</p>
<ol type="1">
<li>The specified font family is searched for.</li>
<li>If not found, the <a href="qfont.html#styleHint">styleHint</a>() is used to select a replacement family.</li>
<li>Each replacement font family is searched for.</li>
<li>If none of these are found or there was no <a href="qfont.html#styleHint">styleHint</a>(), "helvetica" will be searched for.</li>
<li>If "helvetica" isn't found Qt will try the <a href="qfont.html#lastResortFamily">lastResortFamily</a>().</li>
<li>If the <a href="qfont.html#lastResortFamily">lastResortFamily</a>() isn't found Qt will try the <a href="qfont.html#lastResortFont">lastResortFont</a>() which will always return a name of some kind.</li>
</ol>
<p>Note that the actual font matching algorithm varies from platform to platform.</p>
<p>In Windows a request for the "Courier" font is automatically changed to "Courier New", an improved version of Courier that allows for smooth scaling. The older "Courier" bitmap font can be selected by setting the <a href="qfont.html#StyleStrategy-enum">PreferBitmap</a> style strategy (see <a href="qfont.html#setStyleStrategy">setStyleStrategy</a>()).</p>
<p>Once a font is found, the remaining attributes are matched in order of priority:</p>
<ol type="1">
<li><a href="qfont.html#fixedPitch">fixedPitch</a>()</li>
<li><a href="qfont.html#pointSize">pointSize</a>() (see below)</li>
<li><a href="qfont.html#weight">weight</a>()</li>
<li><a href="qfont.html#style">style</a>()</li>
</ol>
<p>If you have a font which matches on family, even if none of the other attributes match, this font will be chosen in preference to a font which doesn't match on family but which does match on the other attributes. This is because font family is the dominant search criteria.</p>
<p>The point size is defined to match if it is within 20% of the requested point size. When several fonts match and are only distinguished by point size, the font with the closest point size to the one requested will be chosen.</p>
<p>The actual family, font size, weight and other font attributes used for drawing text will depend on what's available for the chosen family under the window system. A <a href="qfontinfo.html">QFontInfo</a> object can be used to determine the actual values used for drawing the text.</p>
<p>Examples:</p>
<pre> QFont f("Helvetica");</pre>
<p>If you had both an Adobe and a Cronyx Helvetica, you might get either.</p>
<pre> QFont f("Helvetica [Cronyx]");</pre>
<p>You can specify the foundry you want in the family name. The font f in the above example will be set to "Helvetica [Cronyx]".</p>
<p>To determine the attributes of the font actually used in the window system, use a <a href="qfontinfo.html">QFontInfo</a> object, e.g.</p>
<pre> QFontInfo info(f1);
 QString family = info.family();</pre>
<p>To find out font metrics use a <a href="qfontmetrics.html">QFontMetrics</a> object, e.g.</p>
<pre> QFontMetrics fm(f1);
 int textWidthInPixels = fm.width("How many pixels wide is this text?");
 int textHeightInPixels = fm.height();</pre>
<p>For more general information on fonts, see the <a href="http://nwalsh.com/comp.fonts/FAQ/">comp.fonts FAQ.</a> Information on encodings can be found from <a href="http://czyborra.com/">Roman Czyborra's</a> page.</p>
<p>See also <a href="qfontcombobox.html">QFontComboBox</a>, <a href="qfontmetrics.html">QFontMetrics</a>, <a href="qfontinfo.html">QFontInfo</a>, <a href="qfontdatabase.html">QFontDatabase</a>, and <a href="widgets-charactermap.html">Character Map Example</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Capitalization-enum" />QFont.Capitalization</h3><p>Rendering option for text this font applies to.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.MixedCase</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">This is the normal text rendering option where no capitalization change is applied.</td></tr>
<tr><td valign="top"><tt>QFont.AllUppercase</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">This alters the text to be rendered in all uppercase type.</td></tr>
<tr><td valign="top"><tt>QFont.AllLowercase</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">This alters the text to be rendered in all lowercase type.</td></tr>
<tr><td valign="top"><tt>QFont.SmallCaps</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">This alters the text to be rendered in small-caps type.</td></tr>
<tr><td valign="top"><tt>QFont.Capitalize</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">This alters the text to be rendered with the first character of each word as an uppercase character.</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/tag/QFont/SpacingType" />
<a name="//apple_ref/cpp/econst/QFont/PercentageSpacing" />
<a name="//apple_ref/cpp/econst/QFont/AbsoluteSpacing" />
<h3 class="fn"><a name="SpacingType-enum" />QFont.SpacingType</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.PercentageSpacing</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by the width of the character itself.</td></tr>
<tr><td valign="top"><tt>QFont.AbsoluteSpacing</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/tag/QFont/Stretch" />
<a name="//apple_ref/cpp/econst/QFont/UltraCondensed" />
<a name="//apple_ref/cpp/econst/QFont/ExtraCondensed" />
<a name="//apple_ref/cpp/econst/QFont/Condensed" />
<a name="//apple_ref/cpp/econst/QFont/SemiCondensed" />
<a name="//apple_ref/cpp/econst/QFont/Unstretched" />
<a name="//apple_ref/cpp/econst/QFont/SemiExpanded" />
<a name="//apple_ref/cpp/econst/QFont/Expanded" />
<a name="//apple_ref/cpp/econst/QFont/ExtraExpanded" />
<a name="//apple_ref/cpp/econst/QFont/UltraExpanded" />
<h3 class="fn"><a name="Stretch-enum" />QFont.Stretch</h3><p>Predefined stretch values that follow the CSS naming convention. The higher the value, the more stretched the text is.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.UltraCondensed</tt></td><td align="center" valign="top"><tt>50</tt></td><td valign="top">50</td></tr>
<tr><td valign="top"><tt>QFont.ExtraCondensed</tt></td><td align="center" valign="top"><tt>62</tt></td><td valign="top">62</td></tr>
<tr><td valign="top"><tt>QFont.Condensed</tt></td><td align="center" valign="top"><tt>75</tt></td><td valign="top">75</td></tr>
<tr><td valign="top"><tt>QFont.SemiCondensed</tt></td><td align="center" valign="top"><tt>87</tt></td><td valign="top">87</td></tr>
<tr><td valign="top"><tt>QFont.Unstretched</tt></td><td align="center" valign="top"><tt>100</tt></td><td valign="top">100</td></tr>
<tr><td valign="top"><tt>QFont.SemiExpanded</tt></td><td align="center" valign="top"><tt>112</tt></td><td valign="top">112</td></tr>
<tr><td valign="top"><tt>QFont.Expanded</tt></td><td align="center" valign="top"><tt>125</tt></td><td valign="top">125</td></tr>
<tr><td valign="top"><tt>QFont.ExtraExpanded</tt></td><td align="center" valign="top"><tt>150</tt></td><td valign="top">150</td></tr>
<tr><td valign="top"><tt>QFont.UltraExpanded</tt></td><td align="center" valign="top"><tt>200</tt></td><td valign="top">200</td></tr>
</table></p>
<p>See also <a href="qfont.html#setStretch">setStretch</a>() and <a href="qfont.html#stretch">stretch</a>().</p>
<a name="//apple_ref/cpp/tag/QFont/Style" />
<a name="//apple_ref/cpp/econst/QFont/StyleNormal" />
<a name="//apple_ref/cpp/econst/QFont/StyleItalic" />
<a name="//apple_ref/cpp/econst/QFont/StyleOblique" />
<h3 class="fn"><a name="Style-enum" />QFont.Style</h3><p>This enum describes the different styles of glyphs that are used to display text.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.StyleNormal</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Normal glyphs used in unstyled text.</td></tr>
<tr><td valign="top"><tt>QFont.StyleItalic</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Italic glyphs that are specifically designed for the purpose of representing italicized text.</td></tr>
<tr><td valign="top"><tt>QFont.StyleOblique</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Glyphs with an italic appearance that are typically based on the unstyled glyphs, but are not fine-tuned for the purpose of representing italicized text.</td></tr>
</table></p>
<p>See also <a href="qfont.html#Weight-enum">Weight</a>.</p>
<a name="//apple_ref/cpp/tag/QFont/StyleHint" />
<a name="//apple_ref/cpp/econst/QFont/AnyStyle" />
<a name="//apple_ref/cpp/econst/QFont/SansSerif" />
<a name="//apple_ref/cpp/econst/QFont/Helvetica" />
<a name="//apple_ref/cpp/econst/QFont/Serif" />
<a name="//apple_ref/cpp/econst/QFont/Times" />
<a name="//apple_ref/cpp/econst/QFont/TypeWriter" />
<a name="//apple_ref/cpp/econst/QFont/Courier" />
<a name="//apple_ref/cpp/econst/QFont/OldEnglish" />
<a name="//apple_ref/cpp/econst/QFont/Decorative" />
<a name="//apple_ref/cpp/econst/QFont/System" />
<h3 class="fn"><a name="StyleHint-enum" />QFont.StyleHint</h3><p>Style hints are used by the <a href="qfont.html">font matching</a> algorithm to find an appropriate default family if a selected font family is not available.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.AnyStyle</tt></td><td align="center" valign="top">?</td><td valign="top">leaves the font matching algorithm to choose the family. This is the default.</td></tr>
<tr><td valign="top"><tt>QFont.SansSerif</tt></td><td align="center" valign="top"><tt>Helvetica</tt></td><td valign="top">the font matcher prefer sans serif fonts.</td></tr>
<tr><td valign="top"><tt>QFont.Helvetica</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">is a synonym for <tt>SansSerif</tt>.</td></tr>
<tr><td valign="top"><tt>QFont.Serif</tt></td><td align="center" valign="top"><tt>Times</tt></td><td valign="top">the font matcher prefers serif fonts.</td></tr>
<tr><td valign="top"><tt>QFont.Times</tt></td><td align="center" valign="top">?</td><td valign="top">is a synonym for <tt>Serif</tt>.</td></tr>
<tr><td valign="top"><tt>QFont.TypeWriter</tt></td><td align="center" valign="top"><tt>Courier</tt></td><td valign="top">the font matcher prefers fixed pitch fonts.</td></tr>
<tr><td valign="top"><tt>QFont.Courier</tt></td><td align="center" valign="top">?</td><td valign="top">a synonym for <tt>TypeWriter</tt>.</td></tr>
<tr><td valign="top"><tt>QFont.OldEnglish</tt></td><td align="center" valign="top">?</td><td valign="top">the font matcher prefers decorative fonts.</td></tr>
<tr><td valign="top"><tt>QFont.Decorative</tt></td><td align="center" valign="top"><tt>OldEnglish</tt></td><td valign="top">is a synonym for <tt>OldEnglish</tt>.</td></tr>
<tr><td valign="top"><tt>QFont.System</tt></td><td align="center" valign="top">?</td><td valign="top">the font matcher prefers system fonts.</td></tr>
</table></p>
<a name="//apple_ref/cpp/tag/QFont/StyleStrategy" />
<a name="//apple_ref/cpp/econst/QFont/PreferDefault" />
<a name="//apple_ref/cpp/econst/QFont/PreferBitmap" />
<a name="//apple_ref/cpp/econst/QFont/PreferDevice" />
<a name="//apple_ref/cpp/econst/QFont/PreferOutline" />
<a name="//apple_ref/cpp/econst/QFont/ForceOutline" />
<a name="//apple_ref/cpp/econst/QFont/NoAntialias" />
<a name="//apple_ref/cpp/econst/QFont/PreferAntialias" />
<a name="//apple_ref/cpp/econst/QFont/OpenGLCompatible" />
<a name="//apple_ref/cpp/econst/QFont/NoFontMerging" />
<a name="//apple_ref/cpp/econst/QFont/PreferMatch" />
<a name="//apple_ref/cpp/econst/QFont/PreferQuality" />
<h3 class="fn"><a name="StyleStrategy-enum" />QFont.StyleStrategy</h3><p>The style strategy tells the <a href="qfont.html">font matching</a> algorithm what type of fonts should be used to find an appropriate default family.</p>
<p>The following strategies are available:</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.PreferDefault</tt></td><td align="center" valign="top"><tt>0x0001</tt></td><td valign="top">the default style strategy. It does not prefer any type of font.</td></tr>
<tr><td valign="top"><tt>QFont.PreferBitmap</tt></td><td align="center" valign="top"><tt>0x0002</tt></td><td valign="top">prefers bitmap fonts (as opposed to outline fonts).</td></tr>
<tr><td valign="top"><tt>QFont.PreferDevice</tt></td><td align="center" valign="top"><tt>0x0004</tt></td><td valign="top">prefers device fonts.</td></tr>
<tr><td valign="top"><tt>QFont.PreferOutline</tt></td><td align="center" valign="top"><tt>0x0008</tt></td><td valign="top">prefers outline fonts (as opposed to bitmap fonts).</td></tr>
<tr><td valign="top"><tt>QFont.ForceOutline</tt></td><td align="center" valign="top"><tt>0x0010</tt></td><td valign="top">forces the use of outline fonts.</td></tr>
<tr><td valign="top"><tt>QFont.NoAntialias</tt></td><td align="center" valign="top"><tt>0x0100</tt></td><td valign="top">don't antialias the fonts.</td></tr>
<tr><td valign="top"><tt>QFont.PreferAntialias</tt></td><td align="center" valign="top"><tt>0x0080</tt></td><td valign="top">antialias if possible.</td></tr>
<tr><td valign="top"><tt>QFont.OpenGLCompatible</tt></td><td align="center" valign="top"><tt>0x0200</tt></td><td valign="top">forces the use of OpenGL compatible fonts.</td></tr>
<tr><td valign="top"><tt>QFont.NoFontMerging</tt></td><td align="center" valign="top"><tt>0x8000</tt></td><td valign="top">If a font does not contain a character requested to draw then Qt automatically chooses a similar looking for that contains the character. This flag disables this feature.</td></tr>
</table></p>
<p>Any of these may be OR-ed with one of these flags:</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.PreferMatch</tt></td><td align="center" valign="top"><tt>0x0020</tt></td><td valign="top">prefer an exact match. The font matcher will try to use the exact font size that has been specified.</td></tr>
<tr><td valign="top"><tt>QFont.PreferQuality</tt></td><td align="center" valign="top"><tt>0x0040</tt></td><td valign="top">prefer the best quality font. The font matcher will use the nearest standard point size that the font supports.</td></tr>
</table></p>
<a name="//apple_ref/cpp/tag/QFont/Weight" />
<a name="//apple_ref/cpp/econst/QFont/Light" />
<a name="//apple_ref/cpp/econst/QFont/Normal" />
<a name="//apple_ref/cpp/econst/QFont/DemiBold" />
<a name="//apple_ref/cpp/econst/QFont/Bold" />
<a name="//apple_ref/cpp/econst/QFont/Black" />
<h3 class="fn"><a name="Weight-enum" />QFont.Weight</h3><p>Qt uses a weighting scale from 0 to 99 similar to, but not the same as, the scales used in Windows or CSS. A weight of 0 is ultralight, whilst 99 will be an extremely black.</p>
<p>This enum contains the predefined font weights:</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QFont.Light</tt></td><td align="center" valign="top"><tt>25</tt></td><td valign="top">25</td></tr>
<tr><td valign="top"><tt>QFont.Normal</tt></td><td align="center" valign="top"><tt>50</tt></td><td valign="top">50</td></tr>
<tr><td valign="top"><tt>QFont.DemiBold</tt></td><td align="center" valign="top"><tt>63</tt></td><td valign="top">63</td></tr>
<tr><td valign="top"><tt>QFont.Bold</tt></td><td align="center" valign="top"><tt>75</tt></td><td valign="top">75</td></tr>
<tr><td valign="top"><tt>QFont.Black</tt></td><td align="center" valign="top"><tt>87</tt></td><td valign="top">87</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QFont" />QFont.__init__ (<i>self</i>)</h3><p>Constructs a font object that uses the application's default font.</p>
<p>See also <a href="qapplication.html#setFont">QApplication.setFont</a>() and <a href="qapplication.html#font">QApplication.font</a>().</p>
<h3 class="fn"><a name="QFont-2" />QFont.__init__ (<i>self</i>, QString, int&#160;<i>pointSize</i>&#160;=&#160;-1, int&#160;<i>weight</i>&#160;=&#160;-1, bool&#160;<i>italic</i>&#160;=&#160;False)</h3><p>Constructs a font object with the specified <i>family</i>, <i>pointSize</i>, <i>weight</i> and <i>italic</i> settings.</p>
<p>If <i>pointSize</i> is zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points, except on Symbian where it is 7 points.</p>
<p>The <i>family</i> name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the <i>family</i> is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the <a href="qfont.html">font matching</a> algorithm.</p>
<p>See also <a href="qfont.html#Weight-enum">Weight</a>, <a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), <a href="qfont.html#setWeight">setWeight</a>(), <a href="qfont.html#setItalic">setItalic</a>(), <a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qapplication.html#font">QApplication.font</a>().</p>
<h3 class="fn"><a name="QFont-3" />QFont.__init__ (<i>self</i>, <a href="qfont.html">QFont</a>, <a href="qpaintdevice.html">QPaintDevice</a>)</h3><p>Constructs a font from <i>font</i> for use on the paint device <i>pd</i>.</p>
<h3 class="fn"><a name="QFont-4" />QFont.__init__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Constructs a font that is a copy of <i>font</i>.</p>
<a name="//apple_ref/cpp/instm/QFont/~QFont" />
<h3 class="fn"><a name="QFont-5" />QFont.__init__ (<i>self</i>, QVariant&#160;<i>variant</i>)</h3><h3 class="fn"><a name="bold" />bool QFont.bold (<i>self</i>)</h3><p>Returns true if <a href="qfont.html#weight">weight</a>() is a value greater than <a href="qfont.html#Weight-enum">QFont.Normal</a>; otherwise returns false.</p>
<p>See also <a href="qfont.html#weight">weight</a>(), <a href="qfont.html#setBold">setBold</a>(), and <a href="qfontinfo.html#bold">QFontInfo.bold</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/capitalization" />
<h3 class="fn"><a name="cacheStatistics" />QFont.cacheStatistics ()</h3><h3 class="fn"><a name="capitalization" /><a href="qfont.html#Capitalization-enum">Capitalization</a> QFont.capitalization (<i>self</i>)</h3><p>Returns the current capitalization type of the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#setCapitalization">setCapitalization</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/defaultFamily" />
<h3 class="fn"><a name="cleanup" />QFont.cleanup ()</h3><h3 class="fn"><a name="defaultFamily" />QString QFont.defaultFamily (<i>self</i>)</h3><p>Returns the family name that corresponds to the current style hint.</p>
<p>See also <a href="qfont.html#StyleHint-enum">StyleHint</a>, <a href="qfont.html#styleHint">styleHint</a>(), and <a href="qfont.html#setStyleHint">setStyleHint</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/exactMatch" />
<h3 class="fn"><a name="exactMatch" />bool QFont.exactMatch (<i>self</i>)</h3><p>Returns true if a window system font exactly matching the settings of this font is available.</p>
<p>See also <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/family" />
<h3 class="fn"><a name="family" />QString QFont.family (<i>self</i>)</h3><p>Returns the requested font family name, i.e. the name set in the constructor or the last setFont() call.</p>
<p>See also <a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#substitutes">substitutes</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/fixedPitch" />
<h3 class="fn"><a name="fixedPitch" />bool QFont.fixedPitch (<i>self</i>)</h3><p>Returns true if fixed pitch has been set; otherwise returns false.</p>
<p>See also <a href="qfont.html#setFixedPitch">setFixedPitch</a>() and <a href="qfontinfo.html#fixedPitch">QFontInfo.fixedPitch</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/freetypeFace" />
<h3 class="fn"><a name="fromString" />bool QFont.fromString (<i>self</i>, QString)</h3><p>Sets this font to match the description <i>descrip</i>. The description is a comma-separated list of the font attributes, as returned by <a href="qfont.html#toString">toString</a>().</p>
<p>See also <a href="qfont.html#toString">toString</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/handle" />
<h3 class="fn"><a name="handle" />int QFont.handle (<i>self</i>)</h3><p>Returns the window system handle to the font, for low-level access. Using this function is <i>not</i> portable.</p>
<a name="//apple_ref/cpp/clm/QFont/insertSubstitution" />
<h3 class="fn"><a name="initialize" />QFont.initialize ()</h3><h3 class="fn"><a name="insertSubstitution" />QFont.insertSubstitution (QString, QString)</h3><p>Inserts <i>substituteName</i> into the substitution table for the family <i>familyName</i>.</p>
<p>See also <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(), <a href="qfont.html#removeSubstitution">removeSubstitution</a>(), <a href="qfont.html#substitutions">substitutions</a>(), <a href="qfont.html#substitute">substitute</a>(), and <a href="qfont.html#substitutes">substitutes</a>().</p>
<a name="//apple_ref/cpp/clm/QFont/insertSubstitutions" />
<h3 class="fn"><a name="insertSubstitutions" />QFont.insertSubstitutions (QString, QStringList)</h3><p>Inserts the list of families <i>substituteNames</i> into the substitution list for <i>familyName</i>.</p>
<p>See also <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), <a href="qfont.html#removeSubstitution">removeSubstitution</a>(), <a href="qfont.html#substitutions">substitutions</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/isCopyOf" />
<h3 class="fn"><a name="isCopyOf" />bool QFont.isCopyOf (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Returns true if this font and <i>f</i> are copies of each other, i.e. one of them was created as a copy of the other and neither has been modified since. This is much stricter than equality.</p>
<p>See also <a href="qfont.html#operator-eq">operator=</a>() and <a href="qfont.html#operator-eq-eq">operator==</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/italic" />
<h3 class="fn"><a name="italic" />bool QFont.italic (<i>self</i>)</h3><p>Returns true if the <a href="qfont.html#style">style</a>() of the font is not <a href="qfont.html#Style-enum">QFont.StyleNormal</a></p>
<p>See also <a href="qfont.html#setItalic">setItalic</a>() and <a href="qfont.html#style">style</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/kerning" />
<h3 class="fn"><a name="kerning" />bool QFont.kerning (<i>self</i>)</h3><p>Returns true if kerning should be used when drawing text with this font.</p>
<p>See also <a href="qfont.html#setKerning">setKerning</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/key" />
<h3 class="fn"><a name="key" />QString QFont.key (<i>self</i>)</h3><p>Returns the font's key, a textual representation of a font. It is typically used as the key for a cache or dictionary of fonts.</p>
<p>See also <a href="qmap.html">QMap</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/lastResortFamily" />
<h3 class="fn"><a name="lastResortFamily" />QString QFont.lastResortFamily (<i>self</i>)</h3><p>Returns the "last resort" font family name.</p>
<p>The current implementation tries a wide variety of common fonts, returning the first one it finds. Is is possible that no family is found in which case an empty string is returned.</p>
<p>See also <a href="qfont.html#lastResortFont">lastResortFont</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/lastResortFont" />
<h3 class="fn"><a name="lastResortFont" />QString QFont.lastResortFont (<i>self</i>)</h3><p>Returns a "last resort" font name for the font matching algorithm. This is used if the last resort family is not available. It will always return a name, if necessary returning something like "fixed" or "system".</p>
<p>The current implementation tries a wide variety of common fonts, returning the first one it finds. The implementation may change at any time, but this function will always return a string containing something.</p>
<p>It is theoretically possible that there really isn't a lastResortFont() in which case Qt will abort with an error message. We have not been able to identify a case where this happens. Please <a href="bughowto.html">report it as a bug</a> if it does, preferably with a list of the fonts you have installed.</p>
<p>See also <a href="qfont.html#lastResortFamily">lastResortFamily</a>() and <a href="qfont.html#rawName">rawName</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/letterSpacing" />
<h3 class="fn"><a name="letterSpacing" />float QFont.letterSpacing (<i>self</i>)</h3><p>Returns the letter spacing for the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>(), <a href="qfont.html#letterSpacingType">letterSpacingType</a>(), and <a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/letterSpacingType" />
<h3 class="fn"><a name="letterSpacingType" /><a href="qfont.html#SpacingType-enum">SpacingType</a> QFont.letterSpacingType (<i>self</i>)</h3><p>Returns the spacing type used for letter spacing.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#letterSpacing">letterSpacing</a>(), <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>(), and <a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/macFontID" />
<h3 class="fn"><a name="overline" />bool QFont.overline (<i>self</i>)</h3><p>Returns true if overline has been set; otherwise returns false.</p>
<p>See also <a href="qfont.html#setOverline">setOverline</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/pixelSize" />
<h3 class="fn"><a name="pixelSize" />int QFont.pixelSize (<i>self</i>)</h3><p>Returns the pixel size of the font if it was set with <a href="qfont.html#setPixelSize">setPixelSize</a>(). Returns -1 if the size was set with <a href="qfont.html#setPointSize">setPointSize</a>() or <a href="qfont.html#setPointSizeF">setPointSizeF</a>().</p>
<p>See also <a href="qfont.html#setPixelSize">setPixelSize</a>(), <a href="qfont.html#pointSize">pointSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo.pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo.pixelSize</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/pointSize" />
<h3 class="fn"><a name="pointSize" />int QFont.pointSize (<i>self</i>)</h3><p>Returns the point size of the font. Returns -1 if the font size was specified in pixels.</p>
<p>See also <a href="qfont.html#setPointSize">setPointSize</a>() and <a href="qfont.html#pointSizeF">pointSizeF</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/pointSizeF" />
<h3 class="fn"><a name="pointSizeF" />float QFont.pointSizeF (<i>self</i>)</h3><p>Returns the point size of the font. Returns -1 if the font size was specified in pixels.</p>
<p>See also <a href="qfont.html#pointSize">pointSize</a>(), <a href="qfont.html#setPointSizeF">setPointSizeF</a>(), <a href="qfont.html#pixelSize">pixelSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo.pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo.pixelSize</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/rawMode" />
<h3 class="fn"><a name="rawMode" />bool QFont.rawMode (<i>self</i>)</h3><p>Returns true if raw mode is used for font name matching; otherwise returns false.</p>
<p>See also <a href="qfont.html#setRawMode">setRawMode</a>() and <a href="qfont.html#rawName">rawName</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/rawName" />
<h3 class="fn"><a name="rawName" />QString QFont.rawName (<i>self</i>)</h3><p>Returns the name of the font within the underlying window system.</p>
<p>On X11, this function will return an empty string if Qt is built with FontConfig support; otherwise the XLFD (X Logical Font Description) is returned.</p>
<p>Using the return value of this function is usually <i>not</i> <i>portable</i>.</p>
<p>See also <a href="qfont.html#setRawName">setRawName</a>().</p>
<a name="//apple_ref/cpp/clm/QFont/removeSubstitution" />
<h3 class="fn"><a name="removeSubstitution" />QFont.removeSubstitution (QString)</h3><p>Removes all the substitutions for <i>familyName</i>.</p>
<p>See also <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(), <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), <a href="qfont.html#substitutions">substitutions</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/resolve" />
<h3 class="fn"><a name="resolve" /><a href="qfont.html">QFont</a> QFont.resolve (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>Returns a new <a href="qfont.html">QFont</a> that has attributes copied from <i>other</i> that have not been previously set on this font.</p>
<a name="//apple_ref/cpp/instm/QFont/setBold" />
<h3 class="fn"><a name="setBold" />QFont.setBold (<i>self</i>, bool)</h3><p>If <i>enable</i> is true sets the font's weight to <a href="qfont.html#Weight-enum">QFont.Bold</a>; otherwise sets the weight to <a href="qfont.html#Weight-enum">QFont.Normal</a>.</p>
<p>For finer boldness control use <a href="qfont.html#setWeight">setWeight</a>().</p>
<p>See also <a href="qfont.html#bold">bold</a>() and <a href="qfont.html#setWeight">setWeight</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setCapitalization" />
<h3 class="fn"><a name="setCapitalization" />QFont.setCapitalization (<i>self</i>, <a href="qfont.html#Capitalization-enum">Capitalization</a>)</h3><p>Sets the capitalization of the text in this font to <i>caps</i>.</p>
<p>A font's capitalization makes the text appear in the selected capitalization mode.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#capitalization">capitalization</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setFamily" />
<h3 class="fn"><a name="setFamily" />QFont.setFamily (<i>self</i>, QString)</h3><p>Sets the family name of the font. The name is case insensitive and may include a foundry name.</p>
<p>The <i>family</i> name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the <i>family</i> is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the <a href="qfont.html">font matching</a> algorithm.</p>
<p>See also <a href="qfont.html#family">family</a>(), <a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setFixedPitch" />
<h3 class="fn"><a name="setFixedPitch" />QFont.setFixedPitch (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets fixed pitch on; otherwise sets fixed pitch off.</p>
<p>See also <a href="qfont.html#fixedPitch">fixedPitch</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setItalic" />
<h3 class="fn"><a name="setItalic" />QFont.setItalic (<i>self</i>, bool)</h3><p>Sets the <a href="qfont.html#style">style</a>() of the font to <a href="qfont.html#Style-enum">QFont.StyleItalic</a> if <i>enable</i> is true; otherwise the style is set to <a href="qfont.html#Style-enum">QFont.StyleNormal</a>.</p>
<p>See also <a href="qfont.html#italic">italic</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setKerning" />
<h3 class="fn"><a name="setKerning" />QFont.setKerning (<i>self</i>, bool)</h3><p>Enables kerning for this font if <i>enable</i> is true; otherwise disables it. By default, kerning is enabled.</p>
<p>When kerning is enabled, glyph metrics do not add up anymore, even for Latin text. In other words, the assumption that width('a') + width('b') is equal to width("ab") is not neccesairly true.</p>
<p>See also <a href="qfont.html#kerning">kerning</a>() and <a href="qfontmetrics.html">QFontMetrics</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setLetterSpacing" />
<h3 class="fn"><a name="setLetterSpacing" />QFont.setLetterSpacing (<i>self</i>, <a href="qfont.html#SpacingType-enum">SpacingType</a>, float)</h3><p>Sets the letter spacing for the font to <i>spacing</i> and the type of spacing to <i>type</i>.</p>
<p>Letter spacing changes the default spacing between individual letters in the font. The spacing between the letters can be made smaller as well as larger.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#letterSpacing">letterSpacing</a>(), <a href="qfont.html#letterSpacingType">letterSpacingType</a>(), and <a href="qfont.html#setWordSpacing">setWordSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setOverline" />
<h3 class="fn"><a name="setOverline" />QFont.setOverline (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets overline on; otherwise sets overline off.</p>
<p>See also <a href="qfont.html#overline">overline</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setPixelSize" />
<h3 class="fn"><a name="setPixelSize" />QFont.setPixelSize (<i>self</i>, int)</h3><p>Sets the font size to <i>pixelSize</i> pixels.</p>
<p>Using this function makes the font device dependent. Use <a href="qfont.html#setPointSize">setPointSize</a>() or <a href="qfont.html#setPointSizeF">setPointSizeF</a>() to set the size of the font in a device independent manner.</p>
<p>See also <a href="qfont.html#pixelSize">pixelSize</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setPointSize" />
<h3 class="fn"><a name="setPointSize" />QFont.setPointSize (<i>self</i>, int)</h3><p>Sets the point size to <i>pointSize</i>. The point size must be greater than zero.</p>
<p>See also <a href="qfont.html#pointSize">pointSize</a>() and <a href="qfont.html#setPointSizeF">setPointSizeF</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setPointSizeF" />
<h3 class="fn"><a name="setPointSizeF" />QFont.setPointSizeF (<i>self</i>, float)</h3><p>Sets the point size to <i>pointSize</i>. The point size must be greater than zero. The requested precision may not be achieved on all platforms.</p>
<p>See also <a href="qfont.html#pointSizeF">pointSizeF</a>(), <a href="qfont.html#setPointSize">setPointSize</a>(), and <a href="qfont.html#setPixelSize">setPixelSize</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setRawMode" />
<h3 class="fn"><a name="setRawMode" />QFont.setRawMode (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, turns raw mode on; otherwise turns raw mode off. This function only has an effect under X11.</p>
<p>If raw mode is enabled, Qt will search for an X font with a complete font name matching the family name, ignoring all other values set for the <a href="qfont.html">QFont</a>. If the font name matches several fonts, Qt will use the first font returned by X. <a href="qfontinfo.html">QFontInfo</a> <i>cannot</i> be used to fetch information about a <a href="qfont.html">QFont</a> using raw mode (it will return the values set in the <a href="qfont.html">QFont</a> for all parameters, including the family name).</p>
<p><b>Warning:</b> Do not use raw mode unless you really, really need it! In most (if not all) cases, <a href="qfont.html#setRawName">setRawName</a>() is a much better choice.</p>
<p>See also <a href="qfont.html#rawMode">rawMode</a>() and <a href="qfont.html#setRawName">setRawName</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setRawName" />
<h3 class="fn"><a name="setRawName" />QFont.setRawName (<i>self</i>, QString)</h3><p>Sets a font by its system specific name. The function is particularly useful under X, where system font settings (for example X resources) are usually available in XLFD (X Logical Font Description) form only. You can pass an XLFD as <i>name</i> to this function.</p>
<p>A font set with setRawName() is still a full-featured <a href="qfont.html">QFont</a>. It can be queried (for example with <a href="qfont.html#italic">italic</a>()) or modified (for example with <a href="qfont.html#setItalic">setItalic</a>()) and is therefore also suitable for rendering rich text.</p>
<p>If Qt's internal font database cannot resolve the raw name, the font becomes a raw font with <i>name</i> as its family.</p>
<p>Note that the present implementation does not handle wildcards in XLFDs well, and that font aliases (file <tt>fonts.alias</tt> in the font directory on X11) are not supported.</p>
<p>See also <a href="qfont.html#rawName">rawName</a>(), <a href="qfont.html#setRawMode">setRawMode</a>(), and <a href="qfont.html#setFamily">setFamily</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/setStretch" />
<h3 class="fn"><a name="setStretch" />QFont.setStretch (<i>self</i>, int)</h3><p>Sets the stretch factor for the font.</p>
<p>The stretch factor changes the width of all characters in the font by <i>factor</i> percent. For example, setting <i>factor</i> to 150 results in all characters in the font being 1.5 times (ie. 150%) wider. The default stretch factor is 100. The minimum stretch factor is 1, and the maximum stretch factor is 4000.</p>
<p>The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts.</p>
<p>NOTE: <a href="qfont.html">QFont</a> cannot stretch XLFD fonts. When loading XLFD fonts on X11, the stretch factor is matched against a predefined set of values for the SETWIDTH_NAME field of the XLFD.</p>
<p>See also <a href="qfont.html#stretch">stretch</a>() and <a href="qfont.html#Stretch-enum">QFont.Stretch</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setStrikeOut" />
<h3 class="fn"><a name="setStrikeOut" />QFont.setStrikeOut (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets strikeout on; otherwise sets strikeout off.</p>
<p>See also <a href="qfont.html#strikeOut">strikeOut</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setStyle" />
<h3 class="fn"><a name="setStyle" />QFont.setStyle (<i>self</i>, <a href="qfont.html#Style-enum">Style</a>)</h3><p>Sets the style of the font to <i>style</i>.</p>
<p>See also <a href="qfont.html#style">style</a>(), <a href="qfont.html#italic">italic</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setStyleHint" />
<h3 class="fn"><a name="setStyleHint" />QFont.setStyleHint (<i>self</i>, <a href="qfont.html#StyleHint-enum">StyleHint</a>, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>&#160;<i>strategy</i>&#160;=&#160;QFont.PreferDefault)</h3><p>Sets the style hint and strategy to <i>hint</i> and <i>strategy</i>, respectively.</p>
<p>If these aren't set explicitly the style hint will default to <tt>AnyStyle</tt> and the style strategy to <tt>PreferDefault</tt>.</p>
<p>Qt does not support style hints on X11 since this information is not provided by the window system.</p>
<p>See also <a href="qfont.html#StyleHint-enum">StyleHint</a>, <a href="qfont.html#styleHint">styleHint</a>(), <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>, <a href="qfont.html#styleStrategy">styleStrategy</a>(), and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setStyleStrategy" />
<h3 class="fn"><a name="setStyleStrategy" />QFont.setStyleStrategy (<i>self</i>, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>)</h3><p>Sets the style strategy for the font to <i>s</i>.</p>
<p>See also <a href="qfont.html#styleStrategy">styleStrategy</a>() and <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setUnderline" />
<h3 class="fn"><a name="setUnderline" />QFont.setUnderline (<i>self</i>, bool)</h3><p>If <i>enable</i> is true, sets underline on; otherwise sets underline off.</p>
<p>See also <a href="qfont.html#underline">underline</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setWeight" />
<h3 class="fn"><a name="setWeight" />QFont.setWeight (<i>self</i>, int)</h3><p>Sets the weight the font to <i>weight</i>, which should be a value from the <a href="qfont.html#Weight-enum">QFont.Weight</a> enumeration.</p>
<p>See also <a href="qfont.html#weight">weight</a>() and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/setWordSpacing" />
<h3 class="fn"><a name="setWordSpacing" />QFont.setWordSpacing (<i>self</i>, float)</h3><p>Sets the word spacing for the font to <i>spacing</i>.</p>
<p>Word spacing changes the default spacing between individual words. A positive value increases the word spacing by a corresponding amount of pixels, while a negative value decreases the inter-word spacing accordingly.</p>
<p>Word spacing will not apply to writing systems, where indiviaul words are not separated by white space.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#wordSpacing">wordSpacing</a>() and <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/stretch" />
<h3 class="fn"><a name="stretch" />int QFont.stretch (<i>self</i>)</h3><p>Returns the stretch factor for the font.</p>
<p>See also <a href="qfont.html#setStretch">setStretch</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/strikeOut" />
<h3 class="fn"><a name="strikeOut" />bool QFont.strikeOut (<i>self</i>)</h3><p>Returns true if strikeout has been set; otherwise returns false.</p>
<p>See also <a href="qfont.html#setStrikeOut">setStrikeOut</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/style" />
<h3 class="fn"><a name="style" /><a href="qfont.html#Style-enum">Style</a> QFont.style (<i>self</i>)</h3><p>Returns the style of the font.</p>
<p>See also <a href="qfont.html#setStyle">setStyle</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/styleHint" />
<h3 class="fn"><a name="styleHint" /><a href="qfont.html#StyleHint-enum">StyleHint</a> QFont.styleHint (<i>self</i>)</h3><p>Returns the <a href="qfont.html#StyleHint-enum">StyleHint</a>.</p>
<p>The style hint affects the <a href="qfont.html">font matching</a> algorithm. See <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a> for the list of available hints.</p>
<p>See also <a href="qfont.html#setStyleHint">setStyleHint</a>(), <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a>, and <a href="qfontinfo.html#styleHint">QFontInfo.styleHint</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/styleStrategy" />
<h3 class="fn"><a name="styleStrategy" /><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> QFont.styleStrategy (<i>self</i>)</h3><p>Returns the <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a>.</p>
<p>The style strategy affects the <a href="qfont.html">font matching</a> algorithm. See <a href="qfont.html#StyleStrategy-enum">QFont.StyleStrategy</a> for the list of available strategies.</p>
<p>See also <a href="qfont.html#setStyleStrategy">setStyleStrategy</a>(), <a href="qfont.html#setStyleHint">setStyleHint</a>(), and <a href="qfont.html#StyleHint-enum">QFont.StyleHint</a>.</p>
<a name="//apple_ref/cpp/clm/QFont/substitute" />
<h3 class="fn"><a name="substitute" />QString QFont.substitute (QString)</h3><p>Returns the first family name to be used whenever <i>familyName</i> is specified. The lookup is case insensitive.</p>
<p>If there is no substitution for <i>familyName</i>, <i>familyName</i> is returned.</p>
<p>To obtain a list of substitutions use <a href="qfont.html#substitutes">substitutes</a>().</p>
<p>See also <a href="qfont.html#setFamily">setFamily</a>(), <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(), <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), and <a href="qfont.html#removeSubstitution">removeSubstitution</a>().</p>
<a name="//apple_ref/cpp/clm/QFont/substitutes" />
<h3 class="fn"><a name="substitutes" />QStringList QFont.substitutes (QString)</h3><p>Returns a list of family names to be used whenever <i>familyName</i> is specified. The lookup is case insensitive.</p>
<p>If there is no substitution for <i>familyName</i>, an empty list is returned.</p>
<p>See also <a href="qfont.html#substitute">substitute</a>(), <a href="qfont.html#insertSubstitutions">insertSubstitutions</a>(), <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), and <a href="qfont.html#removeSubstitution">removeSubstitution</a>().</p>
<a name="//apple_ref/cpp/clm/QFont/substitutions" />
<h3 class="fn"><a name="substitutions" />QStringList QFont.substitutions ()</h3><p>Returns a sorted list of substituted family names.</p>
<p>See also <a href="qfont.html#insertSubstitution">insertSubstitution</a>(), <a href="qfont.html#removeSubstitution">removeSubstitution</a>(), and <a href="qfont.html#substitute">substitute</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/toString" />
<h3 class="fn"><a name="toString" />QString QFont.toString (<i>self</i>)</h3><p>Returns a description of the font. The description is a comma-separated list of the attributes, perfectly suited for use in <a href="qsettings.html">QSettings</a>.</p>
<p>See also <a href="qfont.html#fromString">fromString</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/underline" />
<h3 class="fn"><a name="underline" />bool QFont.underline (<i>self</i>)</h3><p>Returns true if underline has been set; otherwise returns false.</p>
<p>See also <a href="qfont.html#setUnderline">setUnderline</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/weight" />
<h3 class="fn"><a name="weight" />int QFont.weight (<i>self</i>)</h3><p>Returns the weight of the font which is one of the enumerated values from <a href="qfont.html#Weight-enum">QFont.Weight</a>.</p>
<p>See also <a href="qfont.html#setWeight">setWeight</a>(), <a href="qfont.html#Weight-enum">Weight</a>, and <a href="qfontinfo.html">QFontInfo</a>.</p>
<a name="//apple_ref/cpp/instm/QFont/wordSpacing" />
<h3 class="fn"><a name="wordSpacing" />float QFont.wordSpacing (<i>self</i>)</h3><p>Returns the word spacing for the font.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qfont.html#setWordSpacing">setWordSpacing</a>() and <a href="qfont.html#setLetterSpacing">setLetterSpacing</a>().</p>
<a name="//apple_ref/cpp/instm/QFont/operator QVariant" />
<h3 class="fn"><a name="__eq__" />bool QFont.__eq__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__ge__" />bool QFont.__ge__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__lt__" />bool QFont.__lt__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><h3 class="fn"><a name="__ne__" />bool QFont.__ne__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>