[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qfont.cpp:236 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QFont Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QFont Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QFont class specifies a font used for drawing text.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qfont-h.html">qfont.h</a>></tt>
|
---|
| 37 | <p><a href="qfont-members.html">List of all member functions.</a>
|
---|
| 38 | <h2>Public Members</h2>
|
---|
| 39 | <ul>
|
---|
| 40 | <li class=fn>enum <a href="#StyleHint-enum"><b>StyleHint</b></a> { Helvetica, SansSerif = Helvetica, Times, Serif = Times, Courier, TypeWriter = Courier, OldEnglish, Decorative = OldEnglish, System, AnyStyle }</li>
|
---|
| 41 | <li class=fn>enum <a href="#StyleStrategy-enum"><b>StyleStrategy</b></a> { PreferDefault = 0x0001, PreferBitmap = 0x0002, PreferDevice = 0x0004, PreferOutline = 0x0008, ForceOutline = 0x0010, PreferMatch = 0x0020, PreferQuality = 0x0040, PreferAntialias = 0x0080, NoAntialias = 0x0100, OpenGLCompatible = 0x0200 }</li>
|
---|
| 42 | <li class=fn>enum <a href="#Weight-enum"><b>Weight</b></a> { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }</li>
|
---|
| 43 | <li class=fn>enum <a href="#Stretch-enum"><b>Stretch</b></a> { UltraCondensed = 50, ExtraCondensed = 62, Condensed = 75, SemiCondensed = 87, Unstretched = 100, SemiExpanded = 112, Expanded = 125, ExtraExpanded = 150, UltraExpanded = 200 }</li>
|
---|
| 44 | <li class=fn><a href="#QFont"><b>QFont</b></a> ()</li>
|
---|
| 45 | <li class=fn><a href="#QFont-2"><b>QFont</b></a> ( const QString & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )</li>
|
---|
| 46 | <li class=fn><a href="#QFont-3"><b>QFont</b></a> ( const QFont & font )</li>
|
---|
| 47 | <li class=fn><a href="#~QFont"><b>~QFont</b></a> ()</li>
|
---|
| 48 | <li class=fn>QString <a href="#family"><b>family</b></a> () const</li>
|
---|
| 49 | <li class=fn>void <a href="#setFamily"><b>setFamily</b></a> ( const QString & family )</li>
|
---|
| 50 | <li class=fn>int <a href="#pointSize"><b>pointSize</b></a> () const</li>
|
---|
| 51 | <li class=fn>float <a href="#pointSizeFloat"><b>pointSizeFloat</b></a> () const</li>
|
---|
| 52 | <li class=fn>void <a href="#setPointSize"><b>setPointSize</b></a> ( int pointSize )</li>
|
---|
| 53 | <li class=fn>void <a href="#setPointSizeFloat"><b>setPointSizeFloat</b></a> ( float pointSize )</li>
|
---|
| 54 | <li class=fn>int <a href="#pixelSize"><b>pixelSize</b></a> () const</li>
|
---|
| 55 | <li class=fn>void <a href="#setPixelSize"><b>setPixelSize</b></a> ( int pixelSize )</li>
|
---|
| 56 | <li class=fn>void setPixelSizeFloat ( float pixelSize ) <em>(obsolete)</em></li>
|
---|
| 57 | <li class=fn>int <a href="#weight"><b>weight</b></a> () const</li>
|
---|
| 58 | <li class=fn>void <a href="#setWeight"><b>setWeight</b></a> ( int weight )</li>
|
---|
| 59 | <li class=fn>bool <a href="#bold"><b>bold</b></a> () const</li>
|
---|
| 60 | <li class=fn>void <a href="#setBold"><b>setBold</b></a> ( bool enable )</li>
|
---|
| 61 | <li class=fn>bool <a href="#italic"><b>italic</b></a> () const</li>
|
---|
| 62 | <li class=fn>void <a href="#setItalic"><b>setItalic</b></a> ( bool enable )</li>
|
---|
| 63 | <li class=fn>bool <a href="#underline"><b>underline</b></a> () const</li>
|
---|
| 64 | <li class=fn>void <a href="#setUnderline"><b>setUnderline</b></a> ( bool enable )</li>
|
---|
| 65 | <li class=fn>bool <a href="#overline"><b>overline</b></a> () const</li>
|
---|
| 66 | <li class=fn>void <a href="#setOverline"><b>setOverline</b></a> ( bool enable )</li>
|
---|
| 67 | <li class=fn>bool <a href="#strikeOut"><b>strikeOut</b></a> () const</li>
|
---|
| 68 | <li class=fn>void <a href="#setStrikeOut"><b>setStrikeOut</b></a> ( bool enable )</li>
|
---|
| 69 | <li class=fn>bool <a href="#fixedPitch"><b>fixedPitch</b></a> () const</li>
|
---|
| 70 | <li class=fn>void <a href="#setFixedPitch"><b>setFixedPitch</b></a> ( bool enable )</li>
|
---|
| 71 | <li class=fn>StyleHint <a href="#styleHint"><b>styleHint</b></a> () const</li>
|
---|
| 72 | <li class=fn>StyleStrategy <a href="#styleStrategy"><b>styleStrategy</b></a> () const</li>
|
---|
| 73 | <li class=fn>void <a href="#setStyleHint"><b>setStyleHint</b></a> ( StyleHint hint, StyleStrategy strategy = PreferDefault )</li>
|
---|
| 74 | <li class=fn>void <a href="#setStyleStrategy"><b>setStyleStrategy</b></a> ( StyleStrategy s )</li>
|
---|
| 75 | <li class=fn>int <a href="#stretch"><b>stretch</b></a> () const</li>
|
---|
| 76 | <li class=fn>void <a href="#setStretch"><b>setStretch</b></a> ( int factor )</li>
|
---|
| 77 | <li class=fn>bool <a href="#rawMode"><b>rawMode</b></a> () const</li>
|
---|
| 78 | <li class=fn>void <a href="#setRawMode"><b>setRawMode</b></a> ( bool enable )</li>
|
---|
| 79 | <li class=fn>bool <a href="#exactMatch"><b>exactMatch</b></a> () const</li>
|
---|
| 80 | <li class=fn>QFont & <a href="#operator-eq"><b>operator=</b></a> ( const QFont & font )</li>
|
---|
| 81 | <li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QFont & f ) const</li>
|
---|
| 82 | <li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QFont & f ) const</li>
|
---|
| 83 | <li class=fn>bool <a href="#isCopyOf"><b>isCopyOf</b></a> ( const QFont & f ) const</li>
|
---|
| 84 | <li class=fn>HFONT <a href="#handle"><b>handle</b></a> () const</li>
|
---|
| 85 | <li class=fn>void <a href="#setRawName"><b>setRawName</b></a> ( const QString & name )</li>
|
---|
| 86 | <li class=fn>QString <a href="#rawName"><b>rawName</b></a> () const</li>
|
---|
| 87 | <li class=fn>QString <a href="#key"><b>key</b></a> () const</li>
|
---|
| 88 | <li class=fn>QString <a href="#toString"><b>toString</b></a> () const</li>
|
---|
| 89 | <li class=fn>bool <a href="#fromString"><b>fromString</b></a> ( const QString & descrip )</li>
|
---|
| 90 | <li class=fn>void <a href="#qwsRenderToDisk"><b>qwsRenderToDisk</b></a> ( bool all = TRUE )</li>
|
---|
| 91 | <li class=fn>enum <a href="#Script-enum"><b>Script</b></a> { Latin, Greek, Cyrillic, Armenian, Georgian, Runic, Ogham, SpacingModifiers, CombiningMarks, Hebrew, Arabic, Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar, Khmer, Han, Hiragana, Katakana, Hangul, Bopomofo, Yi, Ethiopic, Cherokee, CanadianAboriginal, Mongolian, CurrencySymbols, LetterlikeSymbols, NumberForms, MathematicalOperators, TechnicalSymbols, GeometricSymbols, MiscellaneousSymbols, EnclosedAndSquare, Braille, Unicode, Tagalog, Hanunoo, Buhid, Tagbanwa, KatakanaHalfWidth, Limbu, TaiLe }</li>
|
---|
| 92 | <li class=fn>QString <a href="#defaultFamily"><b>defaultFamily</b></a> () const</li>
|
---|
| 93 | <li class=fn>QString <a href="#lastResortFamily"><b>lastResortFamily</b></a> () const</li>
|
---|
| 94 | <li class=fn>QString <a href="#lastResortFont"><b>lastResortFont</b></a> () const</li>
|
---|
| 95 | <li class=fn>QFont <a href="#resolve"><b>resolve</b></a> ( const QFont & other ) const</li>
|
---|
| 96 | </ul>
|
---|
| 97 | <h2>Static Public Members</h2>
|
---|
| 98 | <ul>
|
---|
| 99 | <li class=fn>QString <a href="#substitute"><b>substitute</b></a> ( const QString & familyName )</li>
|
---|
| 100 | <li class=fn>QStringList <a href="#substitutes"><b>substitutes</b></a> ( const QString & familyName )</li>
|
---|
| 101 | <li class=fn>QStringList <a href="#substitutions"><b>substitutions</b></a> ()</li>
|
---|
| 102 | <li class=fn>void <a href="#insertSubstitution"><b>insertSubstitution</b></a> ( const QString & familyName, const QString & substituteName )</li>
|
---|
| 103 | <li class=fn>void <a href="#insertSubstitutions"><b>insertSubstitutions</b></a> ( const QString & familyName, const QStringList & substituteNames )</li>
|
---|
| 104 | <li class=fn>void <a href="#removeSubstitution"><b>removeSubstitution</b></a> ( const QString & familyName )</li>
|
---|
| 105 | <li class=fn>QFont defaultFont () <em>(obsolete)</em></li>
|
---|
| 106 | <li class=fn>void setDefaultFont ( const QFont & f ) <em>(obsolete)</em></li>
|
---|
| 107 | </ul>
|
---|
| 108 | <h2>Protected Members</h2>
|
---|
| 109 | <ul>
|
---|
| 110 | <li class=fn>bool <a href="#dirty"><b>dirty</b></a> () const</li>
|
---|
| 111 | <li class=fn>int <a href="#deciPointSize"><b>deciPointSize</b></a> () const</li>
|
---|
| 112 | </ul>
|
---|
| 113 | <h2>Related Functions</h2>
|
---|
| 114 | <ul>
|
---|
| 115 | <li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QFont & font )</li>
|
---|
| 116 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QFont & font )</li>
|
---|
| 117 | </ul>
|
---|
| 118 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 119 |
|
---|
| 120 |
|
---|
| 121 | The QFont class specifies a font used for drawing text.
|
---|
| 122 | <p>
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 |
|
---|
| 126 | <p> When you create a QFont object you specify various attributes that
|
---|
| 127 | you want the font to have. Qt will use the font with the specified
|
---|
| 128 | attributes, or if no matching font exists, Qt will use the closest
|
---|
| 129 | matching installed font. The attributes of the font that is
|
---|
| 130 | actually used are retrievable from a <a href="qfontinfo.html">QFontInfo</a> object. If the
|
---|
| 131 | window system provides an exact match <a href="#exactMatch">exactMatch</a>() returns TRUE.
|
---|
| 132 | Use <a href="qfontmetrics.html">QFontMetrics</a> to get measurements, e.g. the pixel length of a
|
---|
| 133 | string using <a href="qfontmetrics.html#width">QFontMetrics::width</a>().
|
---|
| 134 | <p> Use <a href="qapplication.html#setFont">QApplication::setFont</a>() to set the application's default font.
|
---|
| 135 | <p> If a choosen X11 font does not include all the characters that
|
---|
| 136 | need to be displayed, QFont will try to find the characters in the
|
---|
| 137 | nearest equivalent fonts. When a <a href="qpainter.html">QPainter</a> draws a character from a
|
---|
| 138 | font the QFont will report whether or not it has the character; if
|
---|
| 139 | it does not, QPainter will draw an unfilled square.
|
---|
| 140 | <p> Create QFonts like this:
|
---|
| 141 | <pre>
|
---|
| 142 | QFont serifFont( "Times", 10, Bold );
|
---|
| 143 | QFont sansFont( "Helvetica [Cronyx]", 12 );
|
---|
| 144 | </pre>
|
---|
| 145 |
|
---|
| 146 | <p> The attributes set in the constructor can also be set later, e.g.
|
---|
| 147 | <a href="#setFamily">setFamily</a>(), <a href="#setPointSize">setPointSize</a>(), <a href="#setPointSizeFloat">setPointSizeFloat</a>(), <a href="#setWeight">setWeight</a>() and
|
---|
| 148 | <a href="#setItalic">setItalic</a>(). The remaining attributes must be set after
|
---|
| 149 | contstruction, e.g. <a href="#setBold">setBold</a>(), <a href="#setUnderline">setUnderline</a>(), <a href="#setOverline">setOverline</a>(),
|
---|
| 150 | <a href="#setStrikeOut">setStrikeOut</a>() and <a href="#setFixedPitch">setFixedPitch</a>(). <a href="qfontinfo.html">QFontInfo</a> objects should be
|
---|
| 151 | created <em>after</em> the font's attributes have been set. A QFontInfo
|
---|
| 152 | object will not change, even if you change the font's
|
---|
| 153 | attributes. The corresponding "get" functions, e.g. <a href="#family">family</a>(),
|
---|
| 154 | <a href="#pointSize">pointSize</a>(), etc., return the values that were set, even though
|
---|
| 155 | the values used may differ. The actual values are available from a
|
---|
| 156 | QFontInfo object.
|
---|
| 157 | <p> If the requested font family is unavailable you can influence the
|
---|
| 158 | <a href="#fontmatching">font matching algorithm</a> by choosing a
|
---|
| 159 | particular <a href="#StyleHint-enum">QFont::StyleHint</a> and <a href="#StyleStrategy-enum">QFont::StyleStrategy</a> with
|
---|
| 160 | <a href="#setStyleHint">setStyleHint</a>(). The default family (corresponding to the current
|
---|
| 161 | style hint) is returned by <a href="#defaultFamily">defaultFamily</a>().
|
---|
| 162 | <p> The font-matching algorithm has a <a href="#lastResortFamily">lastResortFamily</a>() and
|
---|
| 163 | <a href="#lastResortFont">lastResortFont</a>() in cases where a suitable match cannot be found.
|
---|
| 164 | You can provide substitutions for font family names using
|
---|
| 165 | <a href="#insertSubstitution">insertSubstitution</a>() and <a href="#insertSubstitutions">insertSubstitutions</a>(). Substitutions can
|
---|
| 166 | be removed with <a href="#removeSubstitution">removeSubstitution</a>(). Use <a href="#substitute">substitute</a>() to retrieve
|
---|
| 167 | a family's first substitute, or the family name itself if it has
|
---|
| 168 | no substitutes. Use <a href="#substitutes">substitutes</a>() to retrieve a list of a family's
|
---|
| 169 | substitutes (which may be empty).
|
---|
| 170 | <p> Every QFont has a <a href="#key">key</a>() which you can use, for example, as the key
|
---|
| 171 | in a cache or dictionary. If you want to store a user's font
|
---|
| 172 | preferences you could use <a href="qsettings.html">QSettings</a>, writing the font information
|
---|
| 173 | with <a href="#toString">toString</a>() and reading it back with <a href="#fromString">fromString</a>(). The
|
---|
| 174 | <a href="#operator-lt-lt">operator<<</a>() and <a href="#operator-gt-gt">operator>></a>() functions are also available, but
|
---|
| 175 | they work on a data stream.
|
---|
| 176 | <p> It is possible to set the height of characters shown on the screen
|
---|
| 177 | to a specified number of pixels with <a href="#setPixelSize">setPixelSize</a>(); however using
|
---|
| 178 | <a href="#setPointSize">setPointSize</a>() has a similar effect and provides device
|
---|
| 179 | independence.
|
---|
| 180 | <p> Under the X Window System you can set a font using its system
|
---|
| 181 | specific name with <a href="#setRawName">setRawName</a>().
|
---|
| 182 | <p> Loading fonts can be expensive, especially on X11. QFont contains
|
---|
| 183 | extensive optimizations to make the copying of QFont objects fast,
|
---|
| 184 | and to cache the results of the slow window system functions it
|
---|
| 185 | depends upon.
|
---|
| 186 | <p> <a name="fontmatching"></a>
|
---|
| 187 | The font matching algorithm works as follows:
|
---|
| 188 | <ol type=1>
|
---|
| 189 | <li> The specified font family is searched for.
|
---|
| 190 | <li> If not found, the <a href="#styleHint">styleHint</a>() is used to select a replacement
|
---|
| 191 | family.
|
---|
| 192 | <li> Each replacement font family is searched for.
|
---|
| 193 | <li> If none of these are found or there was no styleHint(), "helvetica"
|
---|
| 194 | will be searched for.
|
---|
| 195 | <li> If "helvetica" isn't found Qt will try the <a href="#lastResortFamily">lastResortFamily</a>().
|
---|
| 196 | <li> If the lastResortFamily() isn't found Qt will try the
|
---|
| 197 | <a href="#lastResortFont">lastResortFont</a>() which will always return a name of some kind.
|
---|
| 198 | </ol>
|
---|
| 199 | <p> Once a font is found, the remaining attributes are matched in order of
|
---|
| 200 | priority:
|
---|
| 201 | <ol type=1>
|
---|
| 202 | <li> <a href="#fixedPitch">fixedPitch</a>()
|
---|
| 203 | <li> <a href="#pointSize">pointSize</a>() (see below)
|
---|
| 204 | <li> <a href="#weight">weight</a>()
|
---|
| 205 | <li> <a href="#italic">italic</a>()
|
---|
| 206 | </ol>
|
---|
| 207 | <p> If you have a font which matches on family, even if none of the
|
---|
| 208 | other attributes match, this font will be chosen in preference to
|
---|
| 209 | a font which doesn't match on family but which does match on the
|
---|
| 210 | other attributes. This is because font family is the dominant
|
---|
| 211 | search criteria.
|
---|
| 212 | <p> The point size is defined to match if it is within 20% of the
|
---|
| 213 | requested point size. When several fonts match and are only
|
---|
| 214 | distinguished by point size, the font with the closest point size
|
---|
| 215 | to the one requested will be chosen.
|
---|
| 216 | <p> The actual family, font size, weight and other font attributes
|
---|
| 217 | used for drawing text will depend on what's available for the
|
---|
| 218 | chosen family under the window system. A <a href="qfontinfo.html">QFontInfo</a> object can be
|
---|
| 219 | used to determine the actual values used for drawing the text.
|
---|
| 220 | <p> Examples:
|
---|
| 221 | <p> <pre>
|
---|
| 222 | QFont f("Helvetica");
|
---|
| 223 | </pre>
|
---|
| 224 |
|
---|
| 225 | If you had both an Adobe and a Cronyx Helvetica, you might get
|
---|
| 226 | either.
|
---|
| 227 | <p> <pre>
|
---|
| 228 | QFont f1( "Helvetica [Cronyx]" ); // Qt 3.x
|
---|
| 229 | QFont f2( "Cronyx-Helvetica" ); // Qt 2.x compatibility
|
---|
| 230 | </pre>
|
---|
| 231 |
|
---|
| 232 | You can specify the foundry you want in the family name. Both fonts,
|
---|
| 233 | f1 and f2, in the above example will be set to "Helvetica
|
---|
| 234 | [Cronyx]".
|
---|
| 235 | <p> To determine the attributes of the font actually used in the window
|
---|
| 236 | system, use a QFontInfo object, e.g.
|
---|
| 237 | <pre>
|
---|
| 238 | <a href="qfontinfo.html">QFontInfo</a> info( f1 );
|
---|
| 239 | <a href="qstring.html">QString</a> family = info.<a href="qfontinfo.html#family">family</a>();
|
---|
| 240 | </pre>
|
---|
| 241 |
|
---|
| 242 | <p> To find out font metrics use a <a href="qfontmetrics.html">QFontMetrics</a> object, e.g.
|
---|
| 243 | <pre>
|
---|
| 244 | <a href="qfontmetrics.html">QFontMetrics</a> fm( f1 );
|
---|
| 245 | int pixelWidth = fm.<a href="qfontmetrics.html#width">width</a>( "How many pixels wide is this text?" );
|
---|
| 246 | int pixelHeight = fm.<a href="qfontmetrics.html#height">height</a>();
|
---|
| 247 | </pre>
|
---|
| 248 |
|
---|
| 249 | <p> For more general information on fonts, see the
|
---|
| 250 | <a href="http://www.nwalsh.com/comp.fonts/FAQ/">comp.fonts FAQ.</a>
|
---|
| 251 | Information on encodings can be found from
|
---|
| 252 | <a href="http://czyborra.com/">Roman Czyborra's</a> page.
|
---|
| 253 | <p> <p>See also <a href="qfontmetrics.html">QFontMetrics</a>, <a href="qfontinfo.html">QFontInfo</a>, <a href="qfontdatabase.html">QFontDatabase</a>, <a href="qapplication.html#setFont">QApplication::setFont</a>(), <a href="qwidget.html#font-prop">QWidget::font</a>, <a href="qpainter.html#setFont">QPainter::setFont</a>(), <a href="#StyleHint-enum">QFont::StyleHint</a>, <a href="#Weight-enum">QFont::Weight</a>, <a href="appearance.html">Widget Appearance and Style</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.
|
---|
| 254 |
|
---|
| 255 | <hr><h2>Member Type Documentation</h2>
|
---|
| 256 | <h3 class=fn><a name="Script-enum"></a>QFont::Script</h3>
|
---|
| 257 |
|
---|
| 258 | <p> This enum represents <a href="unicode.html">Unicode</a> allocated
|
---|
| 259 | scripts. For exhaustive coverage see <a href="http://www.amazon.com/exec/obidos/ASIN/0201616335/trolltech/t">The
|
---|
| 260 | Unicode Standard Version 3.0</a>. The following scripts are
|
---|
| 261 | supported:
|
---|
| 262 | <p> Modern European alphabetic scripts (left to right):
|
---|
| 263 | <ul>
|
---|
| 264 | <li><tt>QFont::Latin</tt> - consists of most alphabets based on the original Latin alphabet.
|
---|
| 265 | <li><tt>QFont::Greek</tt> - covers ancient and modern Greek and Coptic.
|
---|
| 266 | <li><tt>QFont::Cyrillic</tt> - covers the Slavic and non-Slavic languages using
|
---|
| 267 | cyrillic alphabets.
|
---|
| 268 | <li><tt>QFont::Armenian</tt> - contains the Armenian alphabet used with the
|
---|
| 269 | Armenian language.
|
---|
| 270 | <li><tt>QFont::Georgian</tt> - covers at least the language Georgian.
|
---|
| 271 | <li><tt>QFont::Runic</tt> - covers the known constituents of the Runic alphabets used
|
---|
| 272 | by the early and medieval societies in the Germanic,
|
---|
| 273 | Scandinavian, and Anglo-Saxon areas.
|
---|
| 274 | <li><tt>QFont::Ogham</tt> - is an alphabetical script used to write a very early
|
---|
| 275 | form of Irish.
|
---|
| 276 | <li><tt>QFont::SpacingModifiers</tt> - are small signs indicating modifications
|
---|
| 277 | to the preceeding letter.
|
---|
| 278 | <li><tt>QFont::CombiningMarks</tt> - consist of diacritical marks not specific to
|
---|
| 279 | a particular alphabet, diacritical marks used in
|
---|
| 280 | combination with mathematical and technical symbols, and
|
---|
| 281 | glyph encodings applied to multiple letterforms.
|
---|
| 282 | </ul><p> Middle Eastern scripts (right to left):
|
---|
| 283 | <ul>
|
---|
| 284 | <li><tt>QFont::Hebrew</tt> - is used for writing Hebrew, Yiddish, and some other languages.
|
---|
| 285 | <li><tt>QFont::Arabic</tt> - covers the Arabic language as well as Persian, Urdu,
|
---|
| 286 | Kurdish and some others.
|
---|
| 287 | <li><tt>QFont::Syriac</tt> - is used to write the active liturgical languages and
|
---|
| 288 | dialects of several Middle Eastern and Southeast Indian
|
---|
| 289 | communities.
|
---|
| 290 | <li><tt>QFont::Thaana</tt> - is used to write the Maledivian Dhivehi language.
|
---|
| 291 | </ul><p> South and Southeast Asian scripts (left to right with few historical exceptions):
|
---|
| 292 | <ul>
|
---|
| 293 | <li><tt>QFont::Devanagari</tt> - covers classical Sanskrit and modern Hindi as
|
---|
| 294 | well as several other languages.
|
---|
| 295 | <li><tt>QFont::Bengali</tt> - is a relative to Devanagari employed to write the
|
---|
| 296 | Bengali language used in West Bengal/India and Bangladesh
|
---|
| 297 | as well as several minority languages.
|
---|
| 298 | <li><tt>QFont::Gurmukhi</tt> - is another Devanagari relative used to write Punjabi.
|
---|
| 299 | <li><tt>QFont::Gujarati</tt> - is closely related to Devanagari and used to write
|
---|
| 300 | the Gujarati language of the Gujarat state in India.
|
---|
| 301 | <li><tt>QFont::Oriya</tt> - is used to write the Oriya language of Orissa state/India.
|
---|
| 302 | <li><tt>QFont::Tamil</tt> - is used to write the Tamil language of Tamil Nadu state/India,
|
---|
| 303 | Sri Lanka, Singapore and parts of Malaysia as well as some
|
---|
| 304 | minority languages.
|
---|
| 305 | <li><tt>QFont::Telugu</tt> - is used to write the Telugu language of Andhra
|
---|
| 306 | Pradesh state/India and some minority languages.
|
---|
| 307 | <li><tt>QFont::Kannada</tt> - is another South Indian script used to write the
|
---|
| 308 | Kannada language of Karnataka state/India and some minority
|
---|
| 309 | languages.
|
---|
| 310 | <li><tt>QFont::Malayalam</tt> - is used to write the Malayalam language of Kerala
|
---|
| 311 | state/India.
|
---|
| 312 | <li><tt>QFont::Sinhala</tt> - is used for Sri Lanka's majority language Sinhala
|
---|
| 313 | and is also employed to write Pali, Sanskrit, and Tamil.
|
---|
| 314 | <li><tt>QFont::Thai</tt> - is used to write Thai and other Southeast Asian languages.
|
---|
| 315 | <li><tt>QFont::Lao</tt> - is a language and script quite similar to Thai.
|
---|
| 316 | <li><tt>QFont::Tibetan</tt> - is the script used to write Tibetan in several
|
---|
| 317 | countries like Tibet, the bordering Indian regions and
|
---|
| 318 | Nepal. It is also used in the Buddist philosophy and
|
---|
| 319 | liturgy of the Mongolian cultural area.
|
---|
| 320 | <li><tt>QFont::Myanmar</tt> - is mainly used to write the Burmese language of
|
---|
| 321 | Myanmar (former Burma).
|
---|
| 322 | <li><tt>QFont::Khmer</tt> - is the official language of Kampuchea.
|
---|
| 323 | </ul><p> East Asian scripts (traditionally top-down, right to left, modern
|
---|
| 324 | often horizontal left to right):
|
---|
| 325 | <ul>
|
---|
| 326 | <li><tt>QFont::Han</tt> - consists of the CJK (Chinese, Japanese, Korean)
|
---|
| 327 | idiographic characters.
|
---|
| 328 | <li><tt>QFont::Hiragana</tt> - is a cursive syllabary used to indicate phonetics
|
---|
| 329 | and pronounciation of Japanese words.
|
---|
| 330 | <li><tt>QFont::Katakana</tt> - is a non-cursive syllabic script used to write
|
---|
| 331 | Japanese words with visual emphasis and non-Japanese words
|
---|
| 332 | in a phonetical manner.
|
---|
| 333 | <li><tt>QFont::Hangul</tt> - is a Korean script consisting of alphabetic components.
|
---|
| 334 | <li><tt>QFont::Bopomofo</tt> - is a phonetic alphabet for Chinese (mainly Mandarin).
|
---|
| 335 | <li><tt>QFont::Yi</tt> - (also called Cuan or Wei) is a syllabary used to write
|
---|
| 336 | the Yi language of Southwestern China, Myanmar, Laos, and Vietnam.
|
---|
| 337 | </ul><p> Additional scripts that do not fit well into the script categories above:
|
---|
| 338 | <ul>
|
---|
| 339 | <li><tt>QFont::Ethiopic</tt> - is a syllabary used by several Central East African languages.
|
---|
| 340 | <li><tt>QFont::Cherokee</tt> - is a left-to-right syllabic script used to write
|
---|
| 341 | the Cherokee language.
|
---|
| 342 | <li><tt>QFont::CanadianAboriginal</tt> - consists of the syllabics used by some
|
---|
| 343 | Canadian aboriginal societies.
|
---|
| 344 | <li><tt>QFont::Mongolian</tt> - is the traditional (and recently reintroduced)
|
---|
| 345 | script used to write Mongolian.
|
---|
| 346 | </ul><p> Symbols:
|
---|
| 347 | <ul>
|
---|
| 348 | <li><tt>QFont::CurrencySymbols</tt> - contains currency symbols not encoded in other scripts.
|
---|
| 349 | <li><tt>QFont::LetterlikeSymbols</tt> - consists of symbols derived from
|
---|
| 350 | ordinary letters of an alphabetical script.
|
---|
| 351 | <li><tt>QFont::NumberForms</tt> - are provided for compatibility with other
|
---|
| 352 | existing character sets.
|
---|
| 353 | <li><tt>QFont::MathematicalOperators</tt> - consists of encodings for operators,
|
---|
| 354 | relations and other symbols like arrows used in a mathematical context.
|
---|
| 355 | <li><tt>QFont::TechnicalSymbols</tt> - contains representations for control
|
---|
| 356 | codes, the space symbol, APL symbols and other symbols
|
---|
| 357 | mainly used in the context of electronic data processing.
|
---|
| 358 | <li><tt>QFont::GeometricSymbols</tt> - covers block elements and geometric shapes.
|
---|
| 359 | <li><tt>QFont::MiscellaneousSymbols</tt> - consists of a heterogeneous collection
|
---|
| 360 | of symbols that do not fit any other Unicode character
|
---|
| 361 | block, e.g. Dingbats.
|
---|
| 362 | <li><tt>QFont::EnclosedAndSquare</tt> - is provided for compatibility with some
|
---|
| 363 | East Asian standards.
|
---|
| 364 | <li><tt>QFont::Braille</tt> - is an international writing system used by blind
|
---|
| 365 | people. This script encodes the 256 eight-dot patterns with
|
---|
| 366 | the 64 six-dot patterns as a subset.
|
---|
| 367 | <li><tt>QFont::Tagalog</tt>
|
---|
| 368 | <li><tt>QFont::Hanunoo</tt>
|
---|
| 369 | <li><tt>QFont::Buhid</tt>
|
---|
| 370 | <li><tt>QFont::Tagbanwa</tt>
|
---|
| 371 | <li><tt>QFont::KatakanaHalfWidth</tt>
|
---|
| 372 | <li><tt>QFont::Limbu</tt> - (Unicode 4.0)
|
---|
| 373 | <li><tt>QFont::TaiLe</tt> - (Unicode 4.0)
|
---|
| 374 | <li><tt>QFont::Unicode</tt> - includes all the above scripts.
|
---|
| 375 | </ul>
|
---|
| 376 | <h3 class=fn><a name="Stretch-enum"></a>QFont::Stretch</h3>
|
---|
| 377 |
|
---|
| 378 | <p> Predefined stretch values that follow the CSS naming convention.
|
---|
| 379 | <ul>
|
---|
| 380 | <li><tt>QFont::UltraCondensed</tt> - 50
|
---|
| 381 | <li><tt>QFont::ExtraCondensed</tt> - 62
|
---|
| 382 | <li><tt>QFont::Condensed</tt> - 75
|
---|
| 383 | <li><tt>QFont::SemiCondensed</tt> - 87
|
---|
| 384 | <li><tt>QFont::Unstretched</tt> - 100
|
---|
| 385 | <li><tt>QFont::SemiExpanded</tt> - 112
|
---|
| 386 | <li><tt>QFont::Expanded</tt> - 125
|
---|
| 387 | <li><tt>QFont::ExtraExpanded</tt> - 150
|
---|
| 388 | <li><tt>QFont::UltraExpanded</tt> - 200
|
---|
| 389 | </ul><p> <p>See also <a href="#setStretch">setStretch</a>() and <a href="#stretch">stretch</a>().
|
---|
| 390 |
|
---|
| 391 | <h3 class=fn><a name="StyleHint-enum"></a>QFont::StyleHint</h3>
|
---|
| 392 |
|
---|
| 393 | <p> Style hints are used by the <a href="#fontmatching">font
|
---|
| 394 | matching</a> algorithm to find an appropriate default family
|
---|
| 395 | if a selected font family is not available.
|
---|
| 396 | <ul>
|
---|
| 397 | <li><tt>QFont::AnyStyle</tt> - leaves the font matching algorithm to choose the
|
---|
| 398 | family. This is the default.
|
---|
| 399 | <li><tt>QFont::SansSerif</tt> - the font matcher prefer sans serif fonts.
|
---|
| 400 | <li><tt>QFont::Helvetica</tt> - is a synonym for <a href="#StyleHint-enum">SansSerif</a>.
|
---|
| 401 | <li><tt>QFont::Serif</tt> - the font matcher prefers serif fonts.
|
---|
| 402 | <li><tt>QFont::Times</tt> - is a synonym for <a href="#StyleHint-enum">Serif</a>.
|
---|
| 403 | <li><tt>QFont::TypeWriter</tt> - the font matcher prefers fixed pitch fonts.
|
---|
| 404 | <li><tt>QFont::Courier</tt> - a synonym for <a href="#StyleHint-enum">TypeWriter</a>.
|
---|
| 405 | <li><tt>QFont::OldEnglish</tt> - the font matcher prefers decorative fonts.
|
---|
| 406 | <li><tt>QFont::Decorative</tt> - is a synonym for <a href="#StyleHint-enum">OldEnglish</a>.
|
---|
| 407 | <li><tt>QFont::System</tt> - the font matcher prefers system fonts.
|
---|
| 408 | </ul>
|
---|
| 409 | <h3 class=fn><a name="StyleStrategy-enum"></a>QFont::StyleStrategy</h3>
|
---|
| 410 |
|
---|
| 411 | <p> The style strategy tells the <a href="#fontmatching">font
|
---|
| 412 | matching</a> algorithm what type of fonts should be used to
|
---|
| 413 | find an appropriate default family.
|
---|
| 414 | <p> The following strategies are available:
|
---|
| 415 | <ul>
|
---|
| 416 | <li><tt>QFont::PreferDefault</tt> - the default style strategy. It does not prefer
|
---|
| 417 | any type of font.
|
---|
| 418 | <li><tt>QFont::PreferBitmap</tt> - prefers bitmap fonts (as opposed to outline
|
---|
| 419 | fonts).
|
---|
| 420 | <li><tt>QFont::PreferDevice</tt> - prefers device fonts.
|
---|
| 421 | <li><tt>QFont::PreferOutline</tt> - prefers outline fonts (as opposed to bitmap fonts).
|
---|
| 422 | <li><tt>QFont::ForceOutline</tt> - forces the use of outline fonts.
|
---|
| 423 | <li><tt>QFont::NoAntialias</tt> - don't antialias the fonts.
|
---|
| 424 | <li><tt>QFont::PreferAntialias</tt> - antialias if possible.
|
---|
| 425 | <li><tt>QFont::OpenGLCompatible</tt> - forces the use of OpenGL compatible
|
---|
| 426 | fonts.
|
---|
| 427 | </ul><p> Any of these may be OR-ed with one of these flags:
|
---|
| 428 | <ul>
|
---|
| 429 | <li><tt>QFont::PreferMatch</tt> - prefer an exact match. The font matcher will try to
|
---|
| 430 | use the exact font size that has been specified.
|
---|
| 431 | <li><tt>QFont::PreferQuality</tt> - prefer the best quality font. The font matcher
|
---|
| 432 | will use the nearest standard point size that the font
|
---|
| 433 | supports.
|
---|
| 434 | </ul>
|
---|
| 435 | <h3 class=fn><a name="Weight-enum"></a>QFont::Weight</h3>
|
---|
| 436 |
|
---|
| 437 | <p> Qt uses a weighting scale from 0 to 99 similar to, but not the
|
---|
| 438 | same as, the scales used in Windows or CSS. A weight of 0 is
|
---|
| 439 | ultralight, whilst 99 will be an extremely black.
|
---|
| 440 | <p> This enum contains the predefined font weights:
|
---|
| 441 | <ul>
|
---|
| 442 | <li><tt>QFont::Light</tt> - 25
|
---|
| 443 | <li><tt>QFont::Normal</tt> - 50
|
---|
| 444 | <li><tt>QFont::DemiBold</tt> - 63
|
---|
| 445 | <li><tt>QFont::Bold</tt> - 75
|
---|
| 446 | <li><tt>QFont::Black</tt> - 87
|
---|
| 447 | </ul>
|
---|
| 448 | <hr><h2>Member Function Documentation</h2>
|
---|
| 449 | <h3 class=fn><a name="QFont"></a>QFont::QFont ()
|
---|
| 450 | </h3>
|
---|
| 451 | Constructs a font object that uses the application's default font.
|
---|
| 452 | <p> <p>See also <a href="qapplication.html#setFont">QApplication::setFont</a>() and <a href="qapplication.html#font">QApplication::font</a>().
|
---|
| 453 |
|
---|
| 454 | <h3 class=fn><a name="QFont-2"></a>QFont::QFont ( const <a href="qstring.html">QString</a> & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )
|
---|
| 455 | </h3>
|
---|
| 456 | Constructs a font object with the specified <em>family</em>, <em>pointSize</em>, <em>weight</em> and <em>italic</em> settings.
|
---|
| 457 | <p> If <em>pointSize</em> is <= 0 it is set to 1.
|
---|
| 458 | <p> The <em>family</em> name may optionally also include a foundry name,
|
---|
| 459 | e.g. "Helvetica [Cronyx]". (The Qt 2.x syntax, i.e.
|
---|
| 460 | "Cronyx-Helvetica", is also supported.) If the <em>family</em> is
|
---|
| 461 | available from more than one foundry and the foundry isn't
|
---|
| 462 | specified, an arbitrary foundry is chosen. If the family isn't
|
---|
| 463 | available a family will be set using the <a href="#fontmatching">font
|
---|
| 464 | matching</a> algorithm.
|
---|
| 465 | <p> <p>See also <a href="#Weight-enum">Weight</a>, <a href="#setFamily">setFamily</a>(), <a href="#setPointSize">setPointSize</a>(), <a href="#setWeight">setWeight</a>(), <a href="#setItalic">setItalic</a>(), <a href="#setStyleHint">setStyleHint</a>(), and <a href="qapplication.html#font">QApplication::font</a>().
|
---|
| 466 |
|
---|
| 467 | <h3 class=fn><a name="QFont-3"></a>QFont::QFont ( const <a href="qfont.html">QFont</a> & font )
|
---|
| 468 | </h3>
|
---|
| 469 | Constructs a font that is a copy of <em>font</em>.
|
---|
| 470 |
|
---|
| 471 | <h3 class=fn><a name="~QFont"></a>QFont::~QFont ()
|
---|
| 472 | </h3>
|
---|
| 473 | Destroys the font object and frees all allocated resources.
|
---|
| 474 |
|
---|
| 475 | <h3 class=fn>bool <a name="bold"></a>QFont::bold () const
|
---|
| 476 | </h3>
|
---|
| 477 |
|
---|
| 478 | <p> Returns TRUE if <a href="#weight">weight</a>() is a value greater than <a href="#Weight-enum">QFont::Normal</a>; otherwise returns FALSE.
|
---|
| 479 | <p> <p>See also <a href="#weight">weight</a>(), <a href="#setBold">setBold</a>(), and <a href="qfontinfo.html#bold">QFontInfo::bold</a>().
|
---|
| 480 |
|
---|
| 481 | <p>Example: <a href="tutorial2-09.html#x2634">chart/optionsform.cpp</a>.
|
---|
| 482 | <h3 class=fn>int <a name="deciPointSize"></a>QFont::deciPointSize () const<tt> [protected]</tt>
|
---|
| 483 | </h3>
|
---|
| 484 | Returns the point size in 1/10ths of a point.
|
---|
| 485 | <p> The returned value will be -1 if the font size has been specified
|
---|
| 486 | in pixels.
|
---|
| 487 | <p> <p>See also <a href="#pointSize">pointSize</a>() and <a href="#pointSizeFloat">pointSizeFloat</a>().
|
---|
| 488 |
|
---|
| 489 | <h3 class=fn><a href="qstring.html">QString</a> <a name="defaultFamily"></a>QFont::defaultFamily () const
|
---|
| 490 | </h3>
|
---|
| 491 | Returns the family name that corresponds to the current style
|
---|
| 492 | hint.
|
---|
| 493 | <p> <p>See also <a href="#StyleHint-enum">StyleHint</a>, <a href="#styleHint">styleHint</a>(), and <a href="#setStyleHint">setStyleHint</a>().
|
---|
| 494 |
|
---|
| 495 | <h3 class=fn><a href="qfont.html">QFont</a> <a name="defaultFont"></a>QFont::defaultFont ()<tt> [static]</tt>
|
---|
| 496 | </h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 497 | <p> Please use <a href="qapplication.html#font">QApplication::font</a>() instead.
|
---|
| 498 |
|
---|
| 499 | <h3 class=fn>bool <a name="dirty"></a>QFont::dirty () const<tt> [protected]</tt>
|
---|
| 500 | </h3>
|
---|
| 501 | Returns TRUE if the font attributes have been changed and the font
|
---|
| 502 | has to be (re)loaded; otherwise returns FALSE.
|
---|
| 503 |
|
---|
| 504 | <h3 class=fn>bool <a name="exactMatch"></a>QFont::exactMatch () const
|
---|
| 505 | </h3>
|
---|
| 506 | Returns TRUE if a window system font exactly matching the settings
|
---|
| 507 | of this font is available.
|
---|
| 508 | <p> <p>See also <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 509 |
|
---|
| 510 | <h3 class=fn><a href="qstring.html">QString</a> <a name="family"></a>QFont::family () const
|
---|
| 511 | </h3>
|
---|
| 512 | Returns the requested font family name, i.e. the name set in the
|
---|
| 513 | constructor or the last setFont() call.
|
---|
| 514 | <p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#substitutes">substitutes</a>(), and <a href="#substitute">substitute</a>().
|
---|
| 515 |
|
---|
| 516 | <p>Examples: <a href="tutorial2-09.html#x2635">chart/optionsform.cpp</a> and <a href="simple-font-demo-example.html#x2838">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 517 | <h3 class=fn>bool <a name="fixedPitch"></a>QFont::fixedPitch () const
|
---|
| 518 | </h3>
|
---|
| 519 | Returns TRUE if fixed pitch has been set; otherwise returns FALSE.
|
---|
| 520 | <p> <p>See also <a href="#setFixedPitch">setFixedPitch</a>() and <a href="qfontinfo.html#fixedPitch">QFontInfo::fixedPitch</a>().
|
---|
| 521 |
|
---|
| 522 | <h3 class=fn>bool <a name="fromString"></a>QFont::fromString ( const <a href="qstring.html">QString</a> & descrip )
|
---|
| 523 | </h3>
|
---|
| 524 | Sets this font to match the description <em>descrip</em>. The description
|
---|
| 525 | is a comma-separated list of the font attributes, as returned by
|
---|
| 526 | <a href="#toString">toString</a>().
|
---|
| 527 | <p> <p>See also <a href="#toString">toString</a>() and <a href="#operator-gt-gt">operator>></a>().
|
---|
| 528 |
|
---|
| 529 | <h3 class=fn>HFONT <a name="handle"></a>QFont::handle () const
|
---|
| 530 | </h3>
|
---|
| 531 | Returns the window system handle to the font, for low-level
|
---|
| 532 | access. Using this function is <em>not</em> portable.
|
---|
| 533 |
|
---|
| 534 | <h3 class=fn>void <a name="insertSubstitution"></a>QFont::insertSubstitution ( const <a href="qstring.html">QString</a> & familyName, const <a href="qstring.html">QString</a> & substituteName )<tt> [static]</tt>
|
---|
| 535 | </h3>
|
---|
| 536 | Inserts the family name <em>substituteName</em> into the substitution
|
---|
| 537 | table for <em>familyName</em>.
|
---|
| 538 | <p> <p>See also <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), <a href="#substitutions">substitutions</a>(), <a href="#substitute">substitute</a>(), and <a href="#substitutes">substitutes</a>().
|
---|
| 539 |
|
---|
| 540 | <p>Example: <a href="simple-font-demo-example.html#x2839">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 541 | <h3 class=fn>void <a name="insertSubstitutions"></a>QFont::insertSubstitutions ( const <a href="qstring.html">QString</a> & familyName, const <a href="qstringlist.html">QStringList</a> & substituteNames )<tt> [static]</tt>
|
---|
| 542 | </h3>
|
---|
| 543 | Inserts the list of families <em>substituteNames</em> into the
|
---|
| 544 | substitution list for <em>familyName</em>.
|
---|
| 545 | <p> <p>See also <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), <a href="#substitutions">substitutions</a>(), and <a href="#substitute">substitute</a>().
|
---|
| 546 |
|
---|
| 547 | <p>Example: <a href="simple-font-demo-example.html#x2840">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 548 | <h3 class=fn>bool <a name="isCopyOf"></a>QFont::isCopyOf ( const <a href="qfont.html">QFont</a> & f ) const
|
---|
| 549 | </h3>
|
---|
| 550 | Returns TRUE if this font and <em>f</em> are copies of each other, i.e.
|
---|
| 551 | one of them was created as a copy of the other and neither has
|
---|
| 552 | been modified since. This is much stricter than equality.
|
---|
| 553 | <p> <p>See also <a href="#operator-eq">operator=</a>() and <a href="#operator-eq-eq">operator==</a>().
|
---|
| 554 |
|
---|
| 555 | <h3 class=fn>bool <a name="italic"></a>QFont::italic () const
|
---|
| 556 | </h3>
|
---|
| 557 | Returns TRUE if italic has been set; otherwise returns FALSE.
|
---|
| 558 | <p> <p>See also <a href="#setItalic">setItalic</a>().
|
---|
| 559 |
|
---|
| 560 | <p>Example: <a href="tutorial2-09.html#x2636">chart/optionsform.cpp</a>.
|
---|
| 561 | <h3 class=fn><a href="qstring.html">QString</a> <a name="key"></a>QFont::key () const
|
---|
| 562 | </h3>
|
---|
| 563 | Returns the font's key, a textual representation of a font. It is
|
---|
| 564 | typically used as the key for a cache or dictionary of fonts.
|
---|
| 565 | <p> <p>See also <a href="qmap.html">QMap</a>.
|
---|
| 566 |
|
---|
| 567 | <h3 class=fn><a href="qstring.html">QString</a> <a name="lastResortFamily"></a>QFont::lastResortFamily () const
|
---|
| 568 | </h3>
|
---|
| 569 | Returns the "last resort" font family name.
|
---|
| 570 | <p> The current implementation tries a wide variety of common fonts,
|
---|
| 571 | returning the first one it finds. Is is possible that no family is
|
---|
| 572 | found in which case a null string is returned.
|
---|
| 573 | <p> <p>See also <a href="#lastResortFont">lastResortFont</a>().
|
---|
| 574 |
|
---|
| 575 | <h3 class=fn><a href="qstring.html">QString</a> <a name="lastResortFont"></a>QFont::lastResortFont () const
|
---|
| 576 | </h3>
|
---|
| 577 | Returns a "last resort" font name for the font matching algorithm.
|
---|
| 578 | This is used if the last resort family is not available. It will
|
---|
| 579 | always return a name, if necessary returning something like
|
---|
| 580 | "fixed" or "system".
|
---|
| 581 | <p> The current implementation tries a wide variety of common fonts,
|
---|
| 582 | returning the first one it finds. The implementation may change
|
---|
| 583 | at any time, but this function will always return a string
|
---|
| 584 | containing something.
|
---|
| 585 | <p> It is theoretically possible that there really isn't a
|
---|
| 586 | <a href="#lastResortFont">lastResortFont</a>() in which case Qt will abort with an error
|
---|
| 587 | message. We have not been able to identify a case where this
|
---|
| 588 | happens. Please <a href="bughowto.html">report it as a bug</a> if
|
---|
| 589 | it does, preferably with a list of the fonts you have installed.
|
---|
| 590 | <p> <p>See also <a href="#lastResortFamily">lastResortFamily</a>() and <a href="#rawName">rawName</a>().
|
---|
| 591 |
|
---|
| 592 | <h3 class=fn>bool <a name="operator!-eq"></a>QFont::operator!= ( const <a href="qfont.html">QFont</a> & f ) const
|
---|
| 593 | </h3>
|
---|
| 594 | Returns TRUE if this font is different from <em>f</em>; otherwise
|
---|
| 595 | returns FALSE.
|
---|
| 596 | <p> Two QFonts are considered to be different if their font attributes
|
---|
| 597 | are different. If <a href="#rawMode">rawMode</a>() is enabled for both fonts, only the
|
---|
| 598 | family fields are compared.
|
---|
| 599 | <p> <p>See also <a href="#operator-eq-eq">operator==</a>().
|
---|
| 600 |
|
---|
| 601 | <h3 class=fn><a href="qfont.html">QFont</a> & <a name="operator-eq"></a>QFont::operator= ( const <a href="qfont.html">QFont</a> & font )
|
---|
| 602 | </h3>
|
---|
| 603 | Assigns <em>font</em> to this font and returns a reference to it.
|
---|
| 604 |
|
---|
| 605 | <h3 class=fn>bool <a name="operator-eq-eq"></a>QFont::operator== ( const <a href="qfont.html">QFont</a> & f ) const
|
---|
| 606 | </h3>
|
---|
| 607 | Returns TRUE if this font is equal to <em>f</em>; otherwise returns
|
---|
| 608 | FALSE.
|
---|
| 609 | <p> Two QFonts are considered equal if their font attributes are
|
---|
| 610 | equal. If <a href="#rawMode">rawMode</a>() is enabled for both fonts, only the family
|
---|
| 611 | fields are compared.
|
---|
| 612 | <p> <p>See also <a href="#operator!-eq">operator!=</a>() and <a href="#isCopyOf">isCopyOf</a>().
|
---|
| 613 |
|
---|
| 614 | <h3 class=fn>bool <a name="overline"></a>QFont::overline () const
|
---|
| 615 | </h3>
|
---|
| 616 | Returns TRUE if overline has been set; otherwise returns FALSE.
|
---|
| 617 | <p> <p>See also <a href="#setOverline">setOverline</a>().
|
---|
| 618 |
|
---|
| 619 | <h3 class=fn>int <a name="pixelSize"></a>QFont::pixelSize () const
|
---|
| 620 | </h3>
|
---|
| 621 | Returns the pixel size of the font if it was set with
|
---|
| 622 | <a href="#setPixelSize">setPixelSize</a>(). Returns -1 if the size was set with <a href="#setPointSize">setPointSize</a>()
|
---|
| 623 | or <a href="#setPointSizeFloat">setPointSizeFloat</a>().
|
---|
| 624 | <p> <p>See also <a href="#setPixelSize">setPixelSize</a>(), <a href="#pointSize">pointSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo::pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo::pixelSize</a>().
|
---|
| 625 |
|
---|
| 626 | <h3 class=fn>int <a name="pointSize"></a>QFont::pointSize () const
|
---|
| 627 | </h3>
|
---|
| 628 | Returns the point size of the font. Returns -1 if the font size
|
---|
| 629 | was specified in pixels.
|
---|
| 630 | <p> <p>See also <a href="#setPointSize">setPointSize</a>(), <a href="#deciPointSize">deciPointSize</a>(), and <a href="#pointSizeFloat">pointSizeFloat</a>().
|
---|
| 631 |
|
---|
| 632 | <p>Examples: <a href="tutorial2-09.html#x2637">chart/optionsform.cpp</a> and <a href="simple-font-demo-example.html#x2841">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 633 | <h3 class=fn>float <a name="pointSizeFloat"></a>QFont::pointSizeFloat () const
|
---|
| 634 | </h3>
|
---|
| 635 | Returns the point size of the font. Returns -1 if the font size was
|
---|
| 636 | specified in pixels.
|
---|
| 637 | <p> <p>See also <a href="#pointSize">pointSize</a>(), <a href="#setPointSizeFloat">setPointSizeFloat</a>(), <a href="#pixelSize">pixelSize</a>(), <a href="qfontinfo.html#pointSize">QFontInfo::pointSize</a>(), and <a href="qfontinfo.html#pixelSize">QFontInfo::pixelSize</a>().
|
---|
| 638 |
|
---|
| 639 | <h3 class=fn>void <a name="qwsRenderToDisk"></a>QFont::qwsRenderToDisk ( bool all = TRUE )
|
---|
| 640 | </h3>
|
---|
| 641 | Saves the glyphs in the font that have previously been accessed as
|
---|
| 642 | a QPF file. If <em>all</em> is TRUE (the default), then before saving,
|
---|
| 643 | all glyphs are marked as used.
|
---|
| 644 | <p> If the font is large and you are sure that only a subset of
|
---|
| 645 | characters will ever be required on the target device, passing
|
---|
| 646 | FALSE for the <em>all</em> parameter can save a significant amount of
|
---|
| 647 | disk space.
|
---|
| 648 | <p> Note that this function is only applicable on Qt/Embedded.
|
---|
| 649 |
|
---|
| 650 | <h3 class=fn>bool <a name="rawMode"></a>QFont::rawMode () const
|
---|
| 651 | </h3>
|
---|
| 652 | Returns TRUE if raw mode is used for font name matching; otherwise
|
---|
| 653 | returns FALSE.
|
---|
| 654 | <p> <p>See also <a href="#setRawMode">setRawMode</a>() and <a href="#rawName">rawName</a>().
|
---|
| 655 |
|
---|
| 656 | <h3 class=fn><a href="qstring.html">QString</a> <a name="rawName"></a>QFont::rawName () const
|
---|
| 657 | </h3>
|
---|
| 658 | Returns the name of the font within the underlying window system.
|
---|
| 659 | <p> On Windows, this is usually just the family name of a TrueType
|
---|
| 660 | font.
|
---|
| 661 | <p> On X11, it is an XLFD (X Logical Font Description). When Qt is
|
---|
| 662 | build with Xft support on X11, the return value can be an Xft
|
---|
| 663 | pattern or an XLFD.
|
---|
| 664 | <p> Using the return value of this function is usually <em>not</em> <em>portable</em>.
|
---|
| 665 | <p> <p>See also <a href="#setRawName">setRawName</a>().
|
---|
| 666 |
|
---|
| 667 | <h3 class=fn>void <a name="removeSubstitution"></a>QFont::removeSubstitution ( const <a href="qstring.html">QString</a> & familyName )<tt> [static]</tt>
|
---|
| 668 | </h3>
|
---|
| 669 | Removes all the substitutions for <em>familyName</em>.
|
---|
| 670 | <p> <p>See also <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#substitutions">substitutions</a>(), and <a href="#substitute">substitute</a>().
|
---|
| 671 |
|
---|
| 672 | <h3 class=fn><a href="qfont.html">QFont</a> <a name="resolve"></a>QFont::resolve ( const <a href="qfont.html">QFont</a> & other ) const
|
---|
| 673 | </h3>
|
---|
| 674 | Returns a new QFont that has attributes copied from <em>other</em>.
|
---|
| 675 |
|
---|
| 676 | <h3 class=fn>void <a name="setBold"></a>QFont::setBold ( bool enable )
|
---|
| 677 | </h3>
|
---|
| 678 |
|
---|
| 679 | <p> If <em>enable</em> is true sets the font's weight to <a href="#Weight-enum">QFont::Bold</a>; otherwise sets the weight to <a href="#Weight-enum">QFont::Normal</a>.
|
---|
| 680 | <p> For finer boldness control use <a href="#setWeight">setWeight</a>().
|
---|
| 681 | <p> <p>See also <a href="#bold">bold</a>() and <a href="#setWeight">setWeight</a>().
|
---|
| 682 |
|
---|
| 683 | <p>Examples: <a href="menu-example.html#x1860">menu/menu.cpp</a> and <a href="themes-example.html#x280">themes/metal.cpp</a>.
|
---|
| 684 | <h3 class=fn>void <a name="setDefaultFont"></a>QFont::setDefaultFont ( const <a href="qfont.html">QFont</a> & f )<tt> [static]</tt>
|
---|
| 685 | </h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 686 | <p> Please use <a href="qapplication.html#setFont">QApplication::setFont</a>() instead.
|
---|
| 687 |
|
---|
| 688 | <h3 class=fn>void <a name="setFamily"></a>QFont::setFamily ( const <a href="qstring.html">QString</a> & family )
|
---|
| 689 | </h3>
|
---|
| 690 | Sets the family name of the font. The name is case insensitive and
|
---|
| 691 | may include a foundry name.
|
---|
| 692 | <p> The <em>family</em> name may optionally also include a foundry name,
|
---|
| 693 | e.g. "Helvetica [Cronyx]". (The Qt 2.x syntax, i.e.
|
---|
| 694 | "Cronyx-Helvetica", is also supported.) If the <em>family</em> is
|
---|
| 695 | available from more than one foundry and the foundry isn't
|
---|
| 696 | specified, an arbitrary foundry is chosen. If the family isn't
|
---|
| 697 | available a family will be set using the <a href="#fontmatching">font
|
---|
| 698 | matching</a> algorithm.
|
---|
| 699 | <p> <p>See also <a href="#family">family</a>(), <a href="#setStyleHint">setStyleHint</a>(), and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 700 |
|
---|
| 701 | <h3 class=fn>void <a name="setFixedPitch"></a>QFont::setFixedPitch ( bool enable )
|
---|
| 702 | </h3>
|
---|
| 703 | If <em>enable</em> is TRUE, sets fixed pitch on; otherwise sets fixed
|
---|
| 704 | pitch off.
|
---|
| 705 | <p> <p>See also <a href="#fixedPitch">fixedPitch</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 706 |
|
---|
| 707 | <h3 class=fn>void <a name="setItalic"></a>QFont::setItalic ( bool enable )
|
---|
| 708 | </h3>
|
---|
| 709 | If <em>enable</em> is TRUE, italic is set on; otherwise italic is set
|
---|
| 710 | off.
|
---|
| 711 | <p> <p>See also <a href="#italic">italic</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 712 |
|
---|
| 713 | <p>Examples: <a href="fileiconview-example.html#x828">fileiconview/qfileiconview.cpp</a>, <a href="simple-font-demo-example.html#x2842">fonts/simple-qfont-demo/viewer.cpp</a>, and <a href="themes-example.html#x281">themes/metal.cpp</a>.
|
---|
| 714 | <h3 class=fn>void <a name="setOverline"></a>QFont::setOverline ( bool enable )
|
---|
| 715 | </h3>
|
---|
| 716 | If <em>enable</em> is TRUE, sets overline on; otherwise sets overline off.
|
---|
| 717 | <p> <p>See also <a href="#overline">overline</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 718 |
|
---|
| 719 | <h3 class=fn>void <a name="setPixelSize"></a>QFont::setPixelSize ( int pixelSize )
|
---|
| 720 | </h3>
|
---|
| 721 | Sets the font size to <em>pixelSize</em> pixels.
|
---|
| 722 | <p> Using this function makes the font device dependent. Use
|
---|
| 723 | <a href="#setPointSize">setPointSize</a>() or <a href="#setPointSizeFloat">setPointSizeFloat</a>() to set the size of the font
|
---|
| 724 | in a device independent manner.
|
---|
| 725 | <p> <p>See also <a href="#pixelSize">pixelSize</a>().
|
---|
| 726 |
|
---|
| 727 | <p>Example: <a href="qwerty-example.html#x367">qwerty/qwerty.cpp</a>.
|
---|
| 728 | <h3 class=fn>void <a name="setPixelSizeFloat"></a>QFont::setPixelSizeFloat ( float pixelSize )
|
---|
| 729 | </h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 730 | <p> Sets the logical pixel height of font characters when shown on
|
---|
| 731 | the screen to <em>pixelSize</em>.
|
---|
| 732 |
|
---|
| 733 | <h3 class=fn>void <a name="setPointSize"></a>QFont::setPointSize ( int pointSize )
|
---|
| 734 | </h3>
|
---|
| 735 | Sets the point size to <em>pointSize</em>. The point size must be
|
---|
| 736 | greater than zero.
|
---|
| 737 | <p> <p>See also <a href="#pointSize">pointSize</a>() and <a href="#setPointSizeFloat">setPointSizeFloat</a>().
|
---|
| 738 |
|
---|
| 739 | <p>Example: <a href="simple-font-demo-example.html#x2843">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 740 | <h3 class=fn>void <a name="setPointSizeFloat"></a>QFont::setPointSizeFloat ( float pointSize )
|
---|
| 741 | </h3>
|
---|
| 742 | Sets the point size to <em>pointSize</em>. The point size must be
|
---|
| 743 | greater than zero. The requested precision may not be achieved on
|
---|
| 744 | all platforms.
|
---|
| 745 | <p> <p>See also <a href="#pointSizeFloat">pointSizeFloat</a>(), <a href="#setPointSize">setPointSize</a>(), and <a href="#setPixelSize">setPixelSize</a>().
|
---|
| 746 |
|
---|
| 747 | <h3 class=fn>void <a name="setRawMode"></a>QFont::setRawMode ( bool enable )
|
---|
| 748 | </h3>
|
---|
| 749 | If <em>enable</em> is TRUE, turns raw mode on; otherwise turns raw mode
|
---|
| 750 | off. This function only has an effect under X11.
|
---|
| 751 | <p> If raw mode is enabled, Qt will search for an X font with a
|
---|
| 752 | complete font name matching the family name, ignoring all other
|
---|
| 753 | values set for the QFont. If the font name matches several fonts,
|
---|
| 754 | Qt will use the first font returned by X. <a href="qfontinfo.html">QFontInfo</a> <em>cannot</em> be
|
---|
| 755 | used to fetch information about a QFont using raw mode (it will
|
---|
| 756 | return the values set in the QFont for all parameters, including
|
---|
| 757 | the family name).
|
---|
| 758 | <p> <b>Warning:</b> Do not use raw mode unless you really, really need it! In
|
---|
| 759 | most (if not all) cases, <a href="#setRawName">setRawName</a>() is a much better choice.
|
---|
| 760 | <p> <p>See also <a href="#rawMode">rawMode</a>() and <a href="#setRawName">setRawName</a>().
|
---|
| 761 |
|
---|
| 762 | <h3 class=fn>void <a name="setRawName"></a>QFont::setRawName ( const <a href="qstring.html">QString</a> & name )
|
---|
| 763 | </h3>
|
---|
| 764 | Sets a font by its system specific name. The function is
|
---|
| 765 | particularly useful under X, where system font settings (for
|
---|
| 766 | example X resources) are usually available in XLFD (X Logical Font
|
---|
| 767 | Description) form only. You can pass an XLFD as <em>name</em> to this
|
---|
| 768 | function.
|
---|
| 769 | <p> A font set with <a href="#setRawName">setRawName</a>() is still a full-featured QFont. It can
|
---|
| 770 | be queried (for example with <a href="#italic">italic</a>()) or modified (for example with
|
---|
| 771 | <a href="#setItalic">setItalic</a>()) and is therefore also suitable for rendering rich text.
|
---|
| 772 | <p> If Qt's internal font database cannot resolve the raw name, the
|
---|
| 773 | font becomes a raw font with <em>name</em> as its family.
|
---|
| 774 | <p> Note that the present implementation does not handle wildcards in
|
---|
| 775 | XLFDs well, and that font aliases (file <tt>fonts.alias</tt> in the font
|
---|
| 776 | directory on X11) are not supported.
|
---|
| 777 | <p> <p>See also <a href="#rawName">rawName</a>(), <a href="#setRawMode">setRawMode</a>(), and <a href="#setFamily">setFamily</a>().
|
---|
| 778 |
|
---|
| 779 | <h3 class=fn>void <a name="setStretch"></a>QFont::setStretch ( int factor )
|
---|
| 780 | </h3>
|
---|
| 781 | Sets the <a href="layout.html#stretch-factor">stretch factor</a> for the font.
|
---|
| 782 | <p> The stretch factor changes the width of all characters in the font
|
---|
| 783 | by <em>factor</em> percent. For example, setting <em>factor</em> to 150
|
---|
| 784 | results in all characters in the font being 1.5 times ( ie. 150% )
|
---|
| 785 | wider. The default stretch factor is 100. The minimum stretch
|
---|
| 786 | factor is 1, and the maximum stretch factor is 4000.
|
---|
| 787 | <p> The stretch factor is only applied to outline fonts. The stretch
|
---|
| 788 | factor is ignored for bitmap fonts.
|
---|
| 789 | <p> NOTE: QFont cannot stretch XLFD fonts. When loading XLFD fonts on
|
---|
| 790 | X11, the stretch factor is matched against a predefined set of
|
---|
| 791 | values for the SETWIDTH_NAME field of the XLFD.
|
---|
| 792 | <p> <p>See also <a href="#stretch">stretch</a>() and <a href="#StyleStrategy-enum">QFont::StyleStrategy</a>.
|
---|
| 793 |
|
---|
| 794 | <h3 class=fn>void <a name="setStrikeOut"></a>QFont::setStrikeOut ( bool enable )
|
---|
| 795 | </h3>
|
---|
| 796 | If <em>enable</em> is TRUE, sets strikeout on; otherwise sets strikeout
|
---|
| 797 | off.
|
---|
| 798 | <p> <p>See also <a href="#strikeOut">strikeOut</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 799 |
|
---|
| 800 | <h3 class=fn>void <a name="setStyleHint"></a>QFont::setStyleHint ( <a href="qfont.html#StyleHint-enum">StyleHint</a> hint, <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> strategy = PreferDefault )
|
---|
| 801 | </h3>
|
---|
| 802 | Sets the style hint and strategy to <em>hint</em> and <em>strategy</em>,
|
---|
| 803 | respectively.
|
---|
| 804 | <p> If these aren't set explicitly the style hint will default to
|
---|
| 805 | <a href="#StyleHint-enum">AnyStyle</a> and the style strategy to <a href="#StyleStrategy-enum">PreferDefault</a>.
|
---|
| 806 | <p> Qt does not support style hints on X11 since this information
|
---|
| 807 | is not provided by the window system.
|
---|
| 808 | <p> <p>See also <a href="#StyleHint-enum">StyleHint</a>, <a href="#styleHint">styleHint</a>(), <a href="#StyleStrategy-enum">StyleStrategy</a>, <a href="#styleStrategy">styleStrategy</a>(), and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 809 |
|
---|
| 810 | <p>Examples: <a href="desktop-example.html#x1728">desktop/desktop.cpp</a> and <a href="simple-font-demo-example.html#x2844">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 811 | <h3 class=fn>void <a name="setStyleStrategy"></a>QFont::setStyleStrategy ( <a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> s )
|
---|
| 812 | </h3>
|
---|
| 813 | Sets the style strategy for the font to <em>s</em>.
|
---|
| 814 | <p> <p>See also <a href="#StyleStrategy-enum">QFont::StyleStrategy</a>.
|
---|
| 815 |
|
---|
| 816 | <h3 class=fn>void <a name="setUnderline"></a>QFont::setUnderline ( bool enable )
|
---|
| 817 | </h3>
|
---|
| 818 | If <em>enable</em> is TRUE, sets underline on; otherwise sets underline
|
---|
| 819 | off.
|
---|
| 820 | <p> <p>See also <a href="#underline">underline</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 821 |
|
---|
| 822 | <p>Examples: <a href="simple-font-demo-example.html#x2845">fonts/simple-qfont-demo/viewer.cpp</a> and <a href="menu-example.html#x1861">menu/menu.cpp</a>.
|
---|
| 823 | <h3 class=fn>void <a name="setWeight"></a>QFont::setWeight ( int weight )
|
---|
| 824 | </h3>
|
---|
| 825 | Sets the weight the font to <em>weight</em>, which should be a value
|
---|
| 826 | from the <a href="#Weight-enum">QFont::Weight</a> enumeration.
|
---|
| 827 | <p> <p>See also <a href="#weight">weight</a>() and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 828 |
|
---|
| 829 | <p>Example: <a href="simple-font-demo-example.html#x2846">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 830 | <h3 class=fn>int <a name="stretch"></a>QFont::stretch () const
|
---|
| 831 | </h3>
|
---|
| 832 | Returns the <a href="layout.html#stretch-factor">stretch factor</a> for the font.
|
---|
| 833 | <p> <p>See also <a href="#setStretch">setStretch</a>().
|
---|
| 834 |
|
---|
| 835 | <h3 class=fn>bool <a name="strikeOut"></a>QFont::strikeOut () const
|
---|
| 836 | </h3>
|
---|
| 837 | Returns TRUE if strikeout has been set; otherwise returns FALSE.
|
---|
| 838 | <p> <p>See also <a href="#setStrikeOut">setStrikeOut</a>().
|
---|
| 839 |
|
---|
| 840 | <h3 class=fn><a href="qfont.html#StyleHint-enum">StyleHint</a> <a name="styleHint"></a>QFont::styleHint () const
|
---|
| 841 | </h3>
|
---|
| 842 | Returns the StyleHint.
|
---|
| 843 | <p> The style hint affects the <a href="#fontmatching">font
|
---|
| 844 | matching</a> algorithm. See <a href="#StyleHint-enum">QFont::StyleHint</a> for the list
|
---|
| 845 | of strategies.
|
---|
| 846 | <p> <p>See also <a href="#setStyleHint">setStyleHint</a>(), <a href="#StyleStrategy-enum">QFont::StyleStrategy</a>, and <a href="qfontinfo.html#styleHint">QFontInfo::styleHint</a>().
|
---|
| 847 |
|
---|
| 848 | <h3 class=fn><a href="qfont.html#StyleStrategy-enum">StyleStrategy</a> <a name="styleStrategy"></a>QFont::styleStrategy () const
|
---|
| 849 | </h3>
|
---|
| 850 | Returns the StyleStrategy.
|
---|
| 851 | <p> The style strategy affects the <a href="#fontmatching">font
|
---|
| 852 | matching</a> algorithm. See <a href="#StyleStrategy-enum">QFont::StyleStrategy</a> for the
|
---|
| 853 | list of strategies.
|
---|
| 854 | <p> <p>See also <a href="#setStyleHint">setStyleHint</a>() and <a href="#StyleHint-enum">QFont::StyleHint</a>.
|
---|
| 855 |
|
---|
| 856 | <h3 class=fn><a href="qstring.html">QString</a> <a name="substitute"></a>QFont::substitute ( const <a href="qstring.html">QString</a> & familyName )<tt> [static]</tt>
|
---|
| 857 | </h3>
|
---|
| 858 | Returns the first family name to be used whenever <em>familyName</em> is
|
---|
| 859 | specified. The lookup is case insensitive.
|
---|
| 860 | <p> If there is no substitution for <em>familyName</em>, <em>familyName</em> is
|
---|
| 861 | returned.
|
---|
| 862 | <p> To obtain a list of substitutions use <a href="#substitutes">substitutes</a>().
|
---|
| 863 | <p> <p>See also <a href="#setFamily">setFamily</a>(), <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), and <a href="#removeSubstitution">removeSubstitution</a>().
|
---|
| 864 |
|
---|
| 865 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="substitutes"></a>QFont::substitutes ( const <a href="qstring.html">QString</a> & familyName )<tt> [static]</tt>
|
---|
| 866 | </h3>
|
---|
| 867 | Returns a list of family names to be used whenever <em>familyName</em>
|
---|
| 868 | is specified. The lookup is case insensitive.
|
---|
| 869 | <p> If there is no substitution for <em>familyName</em>, an empty list is
|
---|
| 870 | returned.
|
---|
| 871 | <p> <p>See also <a href="#substitute">substitute</a>(), <a href="#insertSubstitutions">insertSubstitutions</a>(), <a href="#insertSubstitution">insertSubstitution</a>(), and <a href="#removeSubstitution">removeSubstitution</a>().
|
---|
| 872 |
|
---|
| 873 | <p>Example: <a href="simple-font-demo-example.html#x2847">fonts/simple-qfont-demo/viewer.cpp</a>.
|
---|
| 874 | <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="substitutions"></a>QFont::substitutions ()<tt> [static]</tt>
|
---|
| 875 | </h3>
|
---|
| 876 | Returns a sorted list of substituted family names.
|
---|
| 877 | <p> <p>See also <a href="#insertSubstitution">insertSubstitution</a>(), <a href="#removeSubstitution">removeSubstitution</a>(), and <a href="#substitute">substitute</a>().
|
---|
| 878 |
|
---|
| 879 | <h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QFont::toString () const
|
---|
| 880 | </h3>
|
---|
| 881 | Returns a description of the font. The description is a
|
---|
| 882 | comma-separated list of the attributes, perfectly suited for use
|
---|
| 883 | in <a href="qsettings.html">QSettings</a>.
|
---|
| 884 | <p> <p>See also <a href="#fromString">fromString</a>() and <a href="#operator-lt-lt">operator<<</a>().
|
---|
| 885 |
|
---|
| 886 | <h3 class=fn>bool <a name="underline"></a>QFont::underline () const
|
---|
| 887 | </h3>
|
---|
| 888 | Returns TRUE if underline has been set; otherwise returns FALSE.
|
---|
| 889 | <p> <p>See also <a href="#setUnderline">setUnderline</a>().
|
---|
| 890 |
|
---|
| 891 | <h3 class=fn>int <a name="weight"></a>QFont::weight () const
|
---|
| 892 | </h3>
|
---|
| 893 | Returns the weight of the font which is one of the enumerated
|
---|
| 894 | values from <a href="#Weight-enum">QFont::Weight</a>.
|
---|
| 895 | <p> <p>See also <a href="#setWeight">setWeight</a>(), <a href="#Weight-enum">Weight</a>, and <a href="qfontinfo.html">QFontInfo</a>.
|
---|
| 896 |
|
---|
| 897 | <hr><h2>Related Functions</h2>
|
---|
| 898 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="qfont.html">QFont</a> & font )
|
---|
| 899 | </h3>
|
---|
| 900 |
|
---|
| 901 | <p> Writes the font <em>font</em> to the data stream <em>s</em>. (<a href="#toString">toString</a>()
|
---|
| 902 | writes to a text stream.)
|
---|
| 903 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 904 |
|
---|
| 905 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="qfont.html">QFont</a> & font )
|
---|
| 906 | </h3>
|
---|
| 907 |
|
---|
| 908 | <p> Reads the font <em>font</em> from the data stream <em>s</em>. (<a href="#fromString">fromString</a>()
|
---|
| 909 | reads from a text stream.)
|
---|
| 910 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 911 |
|
---|
| 912 | <!-- eof -->
|
---|
| 913 | <hr><p>
|
---|
| 914 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 915 | Copyright © 1995-2007
|
---|
| 916 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 917 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 918 | <td>Copyright © 2007
|
---|
| 919 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 920 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 921 | </table></div></address></body>
|
---|
| 922 | </html>
|
---|