<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt - 3.3.8 - espenr - 2499/qt - x11 - free - 3.3.8/src/kernel/qfont.cpp:236 -->
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=ISO-8859-1" >
< title > TQFont Class< / title >
< style type = "text/css" > < ! - -
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
-->< / style >
< / head >
< body >
< table border = "0" cellpadding = "0" cellspacing = "0" width = "100%" >
< tr bgcolor = "#E5E5E5" >
< td valign = center >
< a href = "index.html" >
< font color = "#004faf" > Home< / font > < / a >
| < a href = "classes.html" >
< font color = "#004faf" > All Classes< / font > < / a >
| < a href = "mainclasses.html" >
< font color = "#004faf" > Main Classes< / font > < / a >
| < a href = "annotated.html" >
< font color = "#004faf" > Annotated< / font > < / a >
| < a href = "groups.html" >
< font color = "#004faf" > Grouped Classes< / font > < / a >
| < a href = "functions.html" >
< font color = "#004faf" > Functions< / font > < / a >
< / td >
< td align = "right" valign = "center" > < img src = "logo32.png" align = "right" width = "64" height = "32" border = "0" > < / td > < / tr > < / table > < h1 align = center > TQFont Class Reference< / h1 >
< p > The TQFont class specifies a font used for drawing text.
< a href = "#details" > More...< / a >
< p > < tt > #include < < a href = "qfont-h.html" > ntqfont.h< / a > > < / tt >
< p > < a href = "qfont-members.html" > List of all member functions.< / a >
< h2 > Public Members< / h2 >
< ul >
< 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 >
< 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 >
< li class = fn > enum < a href = "#Weight-enum" > < b > Weight< / b > < / a > { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }< / li >
< 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 >
< li class = fn > < a href = "#TQFont" > < b > TQFont< / b > < / a > ()< / li >
< li class = fn > < a href = "#TQFont-2" > < b > TQFont< / b > < / a > ( const TQString & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )< / li >
< li class = fn > < a href = "#TQFont-3" > < b > TQFont< / b > < / a > ( const TQFont & font )< / li >
< li class = fn > < a href = "#~TQFont" > < b > ~TQFont< / b > < / a > ()< / li >
< li class = fn > TQString < a href = "#family" > < b > family< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setFamily" > < b > setFamily< / b > < / a > ( const TQString & family )< / li >
< li class = fn > int < a href = "#pointSize" > < b > pointSize< / b > < / a > () const< / li >
< li class = fn > float < a href = "#pointSizeFloat" > < b > pointSizeFloat< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setPointSize" > < b > setPointSize< / b > < / a > ( int pointSize )< / li >
< li class = fn > void < a href = "#setPointSizeFloat" > < b > setPointSizeFloat< / b > < / a > ( float pointSize )< / li >
< li class = fn > int < a href = "#pixelSize" > < b > pixelSize< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setPixelSize" > < b > setPixelSize< / b > < / a > ( int pixelSize )< / li >
< li class = fn > void setPixelSizeFloat ( float pixelSize ) < em > (obsolete)< / em > < / li >
< li class = fn > int < a href = "#weight" > < b > weight< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setWeight" > < b > setWeight< / b > < / a > ( int weight )< / li >
< li class = fn > bool < a href = "#bold" > < b > bold< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setBold" > < b > setBold< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#italic" > < b > italic< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setItalic" > < b > setItalic< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#underline" > < b > underline< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setUnderline" > < b > setUnderline< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#overline" > < b > overline< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setOverline" > < b > setOverline< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#strikeOut" > < b > strikeOut< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setStrikeOut" > < b > setStrikeOut< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#fixedPitch" > < b > fixedPitch< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setFixedPitch" > < b > setFixedPitch< / b > < / a > ( bool enable )< / li >
< li class = fn > StyleHint < a href = "#styleHint" > < b > styleHint< / b > < / a > () const< / li >
< li class = fn > StyleStrategy < a href = "#styleStrategy" > < b > styleStrategy< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setStyleHint" > < b > setStyleHint< / b > < / a > ( StyleHint hint, StyleStrategy strategy = PreferDefault )< / li >
< li class = fn > void < a href = "#setStyleStrategy" > < b > setStyleStrategy< / b > < / a > ( StyleStrategy s )< / li >
< li class = fn > int < a href = "#stretch" > < b > stretch< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setStretch" > < b > setStretch< / b > < / a > ( int factor )< / li >
< li class = fn > bool < a href = "#rawMode" > < b > rawMode< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setRawMode" > < b > setRawMode< / b > < / a > ( bool enable )< / li >
< li class = fn > bool < a href = "#exactMatch" > < b > exactMatch< / b > < / a > () const< / li >
< li class = fn > TQFont & < a href = "#operator-eq" > < b > operator=< / b > < / a > ( const TQFont & font )< / li >
< li class = fn > bool < a href = "#operator-eq-eq" > < b > operator==< / b > < / a > ( const TQFont & f ) const< / li >
< li class = fn > bool < a href = "#operator!-eq" > < b > operator!=< / b > < / a > ( const TQFont & f ) const< / li >
< li class = fn > bool < a href = "#isCopyOf" > < b > isCopyOf< / b > < / a > ( const TQFont & f ) const< / li >
< li class = fn > HFONT < a href = "#handle" > < b > handle< / b > < / a > () const< / li >
< li class = fn > void < a href = "#setRawName" > < b > setRawName< / b > < / a > ( const TQString & name )< / li >
< li class = fn > TQString < a href = "#rawName" > < b > rawName< / b > < / a > () const< / li >
< li class = fn > TQString < a href = "#key" > < b > key< / b > < / a > () const< / li >
< li class = fn > TQString < a href = "#toString" > < b > toString< / b > < / a > () const< / li >
< li class = fn > bool < a href = "#fromString" > < b > fromString< / b > < / a > ( const TQString & descrip )< / li >
< li class = fn > void < a href = "#qwsRenderToDisk" > < b > qwsRenderToDisk< / b > < / a > ( bool all = TRUE )< / li >
< 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 >
< li class = fn > TQString < a href = "#defaultFamily" > < b > defaultFamily< / b > < / a > () const< / li >
< li class = fn > TQString < a href = "#lastResortFamily" > < b > lastResortFamily< / b > < / a > () const< / li >
< li class = fn > TQString < a href = "#lastResortFont" > < b > lastResortFont< / b > < / a > () const< / li >
< li class = fn > TQFont < a href = "#resolve" > < b > resolve< / b > < / a > ( const TQFont & other ) const< / li >
< / ul >
< h2 > Static Public Members< / h2 >
< ul >
< li class = fn > TQString < a href = "#substitute" > < b > substitute< / b > < / a > ( const TQString & familyName )< / li >
< li class = fn > TQStringList < a href = "#substitutes" > < b > substitutes< / b > < / a > ( const TQString & familyName )< / li >
< li class = fn > TQStringList < a href = "#substitutions" > < b > substitutions< / b > < / a > ()< / li >
< li class = fn > void < a href = "#insertSubstitution" > < b > insertSubstitution< / b > < / a > ( const TQString & familyName, const TQString & substituteName )< / li >
< li class = fn > void < a href = "#insertSubstitutions" > < b > insertSubstitutions< / b > < / a > ( const TQString & familyName, const TQStringList & substituteNames )< / li >
< li class = fn > void < a href = "#removeSubstitution" > < b > removeSubstitution< / b > < / a > ( const TQString & familyName )< / li >
< li class = fn > TQFont defaultFont () < em > (obsolete)< / em > < / li >
< li class = fn > void setDefaultFont ( const TQFont & f ) < em > (obsolete)< / em > < / li >
< / ul >
< h2 > Protected Members< / h2 >
< ul >
< li class = fn > bool < a href = "#dirty" > < b > dirty< / b > < / a > () const< / li >
< li class = fn > int < a href = "#deciPointSize" > < b > deciPointSize< / b > < / a > () const< / li >
< / ul >
< h2 > Related Functions< / h2 >
< ul >
< li class = fn > TQDataStream & < a href = "#operator-lt-lt" > < b > operator< < < / b > < / a > ( TQDataStream & s, const TQFont & font )< / li >
< li class = fn > TQDataStream & < a href = "#operator-gt-gt" > < b > operator> > < / b > < / a > ( TQDataStream & s, TQFont & font )< / li >
< / ul >
< hr > < a name = "details" > < / a > < h2 > Detailed Description< / h2 >
The TQFont class specifies a font used for drawing text.
< p >
< p > When you create a TQFont object you specify various attributes that
you want the font to have. TQt will use the font with the specified
attributes, or if no matching font exists, TQt will use the closest
matching installed font. The attributes of the font that is
actually used are retrievable from a < a href = "ntqfontinfo.html" > TQFontInfo< / a > object. If the
window system provides an exact match < a href = "#exactMatch" > exactMatch< / a > () returns TRUE.
Use < a href = "ntqfontmetrics.html" > TQFontMetrics< / a > to get measurements, e.g. the pixel length of a
string using < a href = "ntqfontmetrics.html#width" > TQFontMetrics::width< / a > ().
< p > Use < a href = "ntqapplication.html#setFont" > TQApplication::setFont< / a > () to set the application's default font.
< p > If a choosen X11 font does not include all the characters that
need to be displayed, TQFont will try to find the characters in the
nearest equivalent fonts. When a < a href = "ntqpainter.html" > TQPainter< / a > draws a character from a
font the TQFont will report whether or not it has the character; if
it does not, TQPainter will draw an unfilled square.
< p > Create TQFonts like this:
< pre >
TQFont serifFont( "Times", 10, Bold );
TQFont sansFont( "Helvetica [Cronyx]", 12 );
< / pre >
< p > The attributes set in the constructor can also be set later, e.g.
< a href = "#setFamily" > setFamily< / a > (), < a href = "#setPointSize" > setPointSize< / a > (), < a href = "#setPointSizeFloat" > setPointSizeFloat< / a > (), < a href = "#setWeight" > setWeight< / a > () and
< a href = "#setItalic" > setItalic< / a > (). The remaining attributes must be set after
contstruction, e.g. < a href = "#setBold" > setBold< / a > (), < a href = "#setUnderline" > setUnderline< / a > (), < a href = "#setOverline" > setOverline< / a > (),
< a href = "#setStrikeOut" > setStrikeOut< / a > () and < a href = "#setFixedPitch" > setFixedPitch< / a > (). < a href = "ntqfontinfo.html" > TQFontInfo< / a > objects should be
created < em > after< / em > the font's attributes have been set. A TQFontInfo
object will not change, even if you change the font's
attributes. The corresponding "get" functions, e.g. < a href = "#family" > family< / a > (),
< a href = "#pointSize" > pointSize< / a > (), etc., return the values that were set, even though
the values used may differ. The actual values are available from a
TQFontInfo object.
< 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 = "#StyleHint-enum" > TQFont::StyleHint< / a > and < a href = "#StyleStrategy-enum" > TQFont::StyleStrategy< / a > with
< a href = "#setStyleHint" > setStyleHint< / a > (). The default family (corresponding to the current
style hint) is returned by < a href = "#defaultFamily" > defaultFamily< / a > ().
< p > The font-matching algorithm has a < a href = "#lastResortFamily" > lastResortFamily< / a > () and
< a href = "#lastResortFont" > lastResortFont< / a > () in cases where a suitable match cannot be found.
You can provide substitutions for font family names using
< a href = "#insertSubstitution" > insertSubstitution< / a > () and < a href = "#insertSubstitutions" > insertSubstitutions< / a > (). Substitutions can
be removed with < a href = "#removeSubstitution" > removeSubstitution< / a > (). Use < a href = "#substitute" > substitute< / a > () to retrieve
a family's first substitute, or the family name itself if it has
no substitutes. Use < a href = "#substitutes" > substitutes< / a > () to retrieve a list of a family's
substitutes (which may be empty).
< p > Every TQFont has a < a href = "#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 = "ntqsettings.html" > TQSettings< / a > , writing the font information
with < a href = "#toString" > toString< / a > () and reading it back with < a href = "#fromString" > fromString< / a > (). The
< a href = "#operator-lt-lt" > operator< < < / a > () and < a href = "#operator-gt-gt" > operator> > < / a > () functions are also available, but
they work on a data stream.
< p > It is possible to set the height of characters shown on the screen
to a specified number of pixels with < a href = "#setPixelSize" > setPixelSize< / a > (); however using
< a href = "#setPointSize" > setPointSize< / a > () has a similar effect and provides device
independence.
< p > Under the X Window System you can set a font using its system
specific name with < a href = "#setRawName" > setRawName< / a > ().
< p > Loading fonts can be expensive, especially on X11. TQFont contains
extensive optimizations to make the copying of TQFont objects fast,
and to cache the results of the slow window system functions it
depends upon.
< p > < a name = "fontmatching" > < / a >
The font matching algorithm works as follows:
< ol type = 1 >
< li > The specified font family is searched for.
< li > If not found, the < a href = "#styleHint" > styleHint< / a > () is used to select a replacement
family.
< li > Each replacement font family is searched for.
< li > If none of these are found or there was no styleHint(), "helvetica"
will be searched for.
< li > If "helvetica" isn't found TQt will try the < a href = "#lastResortFamily" > lastResortFamily< / a > ().
< li > If the lastResortFamily() isn't found TQt will try the
< a href = "#lastResortFont" > lastResortFont< / a > () which will always return a name of some kind.
< / ol >
< p > Once a font is found, the remaining attributes are matched in order of
priority:
< ol type = 1 >
< li > < a href = "#fixedPitch" > fixedPitch< / a > ()
< li > < a href = "#pointSize" > pointSize< / a > () (see below)
< li > < a href = "#weight" > weight< / a > ()
< li > < a href = "#italic" > italic< / a > ()
< / 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 > 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 > 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 = "ntqfontinfo.html" > TQFontInfo< / a > object can be
used to determine the actual values used for drawing the text.
< p > Examples:
< p > < pre >
TQFont f("Helvetica");
< / pre >
If you had both an Adobe and a Cronyx Helvetica, you might get
either.
< p > < pre >
TQFont f1( "Helvetica [Cronyx]" ); // TQt 3.x
TQFont f2( "Cronyx-Helvetica" ); // TQt 2.x compatibility
< / pre >
You can specify the foundry you want in the family name. Both fonts,
f1 and f2, in the above example will be set to "Helvetica
[Cronyx]".
< p > To determine the attributes of the font actually used in the window
system, use a TQFontInfo object, e.g.
< pre >
< a href = "ntqfontinfo.html" > TQFontInfo< / a > info( f1 );
< a href = "tqstring.html" > TQString< / a > family = info.< a href = "ntqfontinfo.html#family" > family< / a > ();
< / pre >
< p > To find out font metrics use a < a href = "ntqfontmetrics.html" > TQFontMetrics< / a > object, e.g.
< pre >
< a href = "ntqfontmetrics.html" > TQFontMetrics< / a > fm( f1 );
int pixelWidth = fm.< a href = "ntqfontmetrics.html#width" > width< / a > ( "How many pixels wide is this text?" );
int pixelHeight = fm.< a href = "ntqfontmetrics.html#height" > height< / a > ();
< / pre >
< p > For more general information on fonts, see the
< a href = "http://www.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 = "ntqfontmetrics.html" > TQFontMetrics< / a > , < a href = "ntqfontinfo.html" > TQFontInfo< / a > , < a href = "ntqfontdatabase.html" > TQFontDatabase< / a > , < a href = "ntqapplication.html#setFont" > TQApplication::setFont< / a > (), < a href = "tqwidget.html#font-prop" > TQWidget::font< / a > , < a href = "ntqpainter.html#setFont" > TQPainter::setFont< / a > (), < a href = "#StyleHint-enum" > TQFont::StyleHint< / a > , < a href = "#Weight-enum" > TQFont::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 > .
< hr > < h2 > Member Type Documentation< / h2 >
< h3 class = fn > < a name = "Script-enum" > < / a > TQFont::Script< / h3 >
< p > This enum represents < a href = "unicode.html" > Unicode< / a > allocated
scripts. For exhaustive coverage see < a href = "http://www.amazon.com/exec/obidos/ASIN/0201616335/trolltech/t" > The
Unicode Standard Version 3.0< / a > . The following scripts are
supported:
< p > Modern European alphabetic scripts (left to right):
< ul >
< li > < tt > TQFont::Latin< / tt > - consists of most alphabets based on the original Latin alphabet.
< li > < tt > TQFont::Greek< / tt > - covers ancient and modern Greek and Coptic.
< li > < tt > TQFont::Cyrillic< / tt > - covers the Slavic and non-Slavic languages using
cyrillic alphabets.
< li > < tt > TQFont::Armenian< / tt > - contains the Armenian alphabet used with the
Armenian language.
< li > < tt > TQFont::Georgian< / tt > - covers at least the language Georgian.
< li > < tt > TQFont::Runic< / tt > - covers the known constituents of the Runic alphabets used
by the early and medieval societies in the Germanic,
Scandinavian, and Anglo-Saxon areas.
< li > < tt > TQFont::Ogham< / tt > - is an alphabetical script used to write a very early
form of Irish.
< li > < tt > TQFont::SpacingModifiers< / tt > - are small signs indicating modifications
to the preceeding letter.
< li > < tt > TQFont::CombiningMarks< / tt > - consist of diacritical marks not specific to
a particular alphabet, diacritical marks used in
combination with mathematical and technical symbols, and
glyph encodings applied to multiple letterforms.
< / ul > < p > Middle Eastern scripts (right to left):
< ul >
< li > < tt > TQFont::Hebrew< / tt > - is used for writing Hebrew, Yiddish, and some other languages.
< li > < tt > TQFont::Arabic< / tt > - covers the Arabic language as well as Persian, Urdu,
Kurdish and some others.
< li > < tt > TQFont::Syriac< / tt > - is used to write the active liturgical languages and
dialects of several Middle Eastern and Southeast Indian
communities.
< li > < tt > TQFont::Thaana< / tt > - is used to write the Maledivian Dhivehi language.
< / ul > < p > South and Southeast Asian scripts (left to right with few historical exceptions):
< ul >
< li > < tt > TQFont::Devanagari< / tt > - covers classical Sanskrit and modern Hindi as
well as several other languages.
< li > < tt > TQFont::Bengali< / tt > - is a relative to Devanagari employed to write the
Bengali language used in West Bengal/India and Bangladesh
as well as several minority languages.
< li > < tt > TQFont::Gurmukhi< / tt > - is another Devanagari relative used to write Punjabi.
< li > < tt > TQFont::Gujarati< / tt > - is closely related to Devanagari and used to write
the Gujarati language of the Gujarat state in India.
< li > < tt > TQFont::Oriya< / tt > - is used to write the Oriya language of Orissa state/India.
< li > < tt > TQFont::Tamil< / tt > - is used to write the Tamil language of Tamil Nadu state/India,
Sri Lanka, Singapore and parts of Malaysia as well as some
minority languages.
< li > < tt > TQFont::Telugu< / tt > - is used to write the Telugu language of Andhra
Pradesh state/India and some minority languages.
< li > < tt > TQFont::Kannada< / tt > - is another South Indian script used to write the
Kannada language of Karnataka state/India and some minority
languages.
< li > < tt > TQFont::Malayalam< / tt > - is used to write the Malayalam language of Kerala
state/India.
< li > < tt > TQFont::Sinhala< / tt > - is used for Sri Lanka's majority language Sinhala
and is also employed to write Pali, Sanskrit, and Tamil.
< li > < tt > TQFont::Thai< / tt > - is used to write Thai and other Southeast Asian languages.
< li > < tt > TQFont::Lao< / tt > - is a language and script quite similar to Thai.
< li > < tt > TQFont::Tibetan< / tt > - is the script used to write Tibetan in several
countries like Tibet, the bordering Indian regions and
Nepal. It is also used in the Buddist philosophy and
liturgy of the Mongolian cultural area.
< li > < tt > TQFont::Myanmar< / tt > - is mainly used to write the Burmese language of
Myanmar (former Burma).
< li > < tt > TQFont::Khmer< / tt > - is the official language of Kampuchea.
< / ul > < p > East Asian scripts (traditionally top-down, right to left, modern
often horizontal left to right):
< ul >
< li > < tt > TQFont::Han< / tt > - consists of the CJK (Chinese, Japanese, Korean)
idiographic characters.
< li > < tt > TQFont::Hiragana< / tt > - is a cursive syllabary used to indicate phonetics
and pronounciation of Japanese words.
< li > < tt > TQFont::Katakana< / tt > - is a non-cursive syllabic script used to write
Japanese words with visual emphasis and non-Japanese words
in a phonetical manner.
< li > < tt > TQFont::Hangul< / tt > - is a Korean script consisting of alphabetic components.
< li > < tt > TQFont::Bopomofo< / tt > - is a phonetic alphabet for Chinese (mainly Mandarin).
< li > < tt > TQFont::Yi< / tt > - (also called Cuan or Wei) is a syllabary used to write
the Yi language of Southwestern China, Myanmar, Laos, and Vietnam.
< / ul > < p > Additional scripts that do not fit well into the script categories above:
< ul >
< li > < tt > TQFont::Ethiopic< / tt > - is a syllabary used by several Central East African languages.
< li > < tt > TQFont::Cherokee< / tt > - is a left-to-right syllabic script used to write
the Cherokee language.
< li > < tt > TQFont::CanadianAboriginal< / tt > - consists of the syllabics used by some
Canadian aboriginal societies.
< li > < tt > TQFont::Mongolian< / tt > - is the traditional (and recently reintroduced)
script used to write Mongolian.
< / ul > < p > Symbols:
< ul >
< li > < tt > TQFont::CurrencySymbols< / tt > - contains currency symbols not encoded in other scripts.
< li > < tt > TQFont::LetterlikeSymbols< / tt > - consists of symbols derived from
ordinary letters of an alphabetical script.
< li > < tt > TQFont::NumberForms< / tt > - are provided for compatibility with other
existing character sets.
< li > < tt > TQFont::MathematicalOperators< / tt > - consists of encodings for operators,
relations and other symbols like arrows used in a mathematical context.
< li > < tt > TQFont::TechnicalSymbols< / tt > - contains representations for control
codes, the space symbol, APL symbols and other symbols
mainly used in the context of electronic data processing.
< li > < tt > TQFont::GeometricSymbols< / tt > - covers block elements and geometric shapes.
< li > < tt > TQFont::MiscellaneousSymbols< / tt > - consists of a heterogeneous collection
of symbols that do not fit any other Unicode character
block, e.g. Dingbats.
< li > < tt > TQFont::EnclosedAndSquare< / tt > - is provided for compatibility with some
East Asian standards.
< li > < tt > TQFont::Braille< / tt > - is an international writing system used by blind
people. This script encodes the 256 eight-dot patterns with
the 64 six-dot patterns as a subset.
< li > < tt > TQFont::Tagalog< / tt >
< li > < tt > TQFont::Hanunoo< / tt >
< li > < tt > TQFont::Buhid< / tt >
< li > < tt > TQFont::Tagbanwa< / tt >
< li > < tt > TQFont::KatakanaHalfWidth< / tt >
< li > < tt > TQFont::Limbu< / tt > - (Unicode 4.0)
< li > < tt > TQFont::TaiLe< / tt > - (Unicode 4.0)
< li > < tt > TQFont::Unicode< / tt > - includes all the above scripts.
< / ul >
< h3 class = fn > < a name = "Stretch-enum" > < / a > TQFont::Stretch< / h3 >
< p > Predefined stretch values that follow the CSS naming convention.
< ul >
< li > < tt > TQFont::UltraCondensed< / tt > - 50
< li > < tt > TQFont::ExtraCondensed< / tt > - 62
< li > < tt > TQFont::Condensed< / tt > - 75
< li > < tt > TQFont::SemiCondensed< / tt > - 87
< li > < tt > TQFont::Unstretched< / tt > - 100
< li > < tt > TQFont::SemiExpanded< / tt > - 112
< li > < tt > TQFont::Expanded< / tt > - 125
< li > < tt > TQFont::ExtraExpanded< / tt > - 150
< li > < tt > TQFont::UltraExpanded< / tt > - 200
< / ul > < p > < p > See also < a href = "#setStretch" > setStretch< / a > () and < a href = "#stretch" > stretch< / a > ().
< h3 class = fn > < a name = "StyleHint-enum" > < / a > TQFont::StyleHint< / h3 >
< p > Style hints are used by the < a href = "#fontmatching" > font
matching< / a > algorithm to find an appropriate default family
if a selected font family is not available.
< ul >
< li > < tt > TQFont::AnyStyle< / tt > - leaves the font matching algorithm to choose the
family. This is the default.
< li > < tt > TQFont::SansSerif< / tt > - the font matcher prefer sans serif fonts.
< li > < tt > TQFont::Helvetica< / tt > - is a synonym for < a href = "#StyleHint-enum" > SansSerif< / a > .
< li > < tt > TQFont::Serif< / tt > - the font matcher prefers serif fonts.
< li > < tt > TQFont::Times< / tt > - is a synonym for < a href = "#StyleHint-enum" > Serif< / a > .
< li > < tt > TQFont::TypeWriter< / tt > - the font matcher prefers fixed pitch fonts.
< li > < tt > TQFont::Courier< / tt > - a synonym for < a href = "#StyleHint-enum" > TypeWriter< / a > .
< li > < tt > TQFont::OldEnglish< / tt > - the font matcher prefers decorative fonts.
< li > < tt > TQFont::Decorative< / tt > - is a synonym for < a href = "#StyleHint-enum" > OldEnglish< / a > .
< li > < tt > TQFont::System< / tt > - the font matcher prefers system fonts.
< / ul >
< h3 class = fn > < a name = "StyleStrategy-enum" > < / a > TQFont::StyleStrategy< / h3 >
< p > The style strategy tells the < a href = "#fontmatching" > font
matching< / a > algorithm what type of fonts should be used to
find an appropriate default family.
< p > The following strategies are available:
< ul >
< li > < tt > TQFont::PreferDefault< / tt > - the default style strategy. It does not prefer
any type of font.
< li > < tt > TQFont::PreferBitmap< / tt > - prefers bitmap fonts (as opposed to outline
fonts).
< li > < tt > TQFont::PreferDevice< / tt > - prefers device fonts.
< li > < tt > TQFont::PreferOutline< / tt > - prefers outline fonts (as opposed to bitmap fonts).
< li > < tt > TQFont::ForceOutline< / tt > - forces the use of outline fonts.
< li > < tt > TQFont::NoAntialias< / tt > - don't antialias the fonts.
< li > < tt > TQFont::PreferAntialias< / tt > - antialias if possible.
< li > < tt > TQFont::OpenGLCompatible< / tt > - forces the use of OpenGL compatible
fonts.
< / ul > < p > Any of these may be OR-ed with one of these flags:
< ul >
< li > < tt > TQFont::PreferMatch< / tt > - prefer an exact match. The font matcher will try to
use the exact font size that has been specified.
< li > < tt > TQFont::PreferQuality< / tt > - prefer the best quality font. The font matcher
will use the nearest standard point size that the font
supports.
< / ul >
< h3 class = fn > < a name = "Weight-enum" > < / a > TQFont::Weight< / h3 >
< p > TQt 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 > This enum contains the predefined font weights:
< ul >
< li > < tt > TQFont::Light< / tt > - 25
< li > < tt > TQFont::Normal< / tt > - 50
< li > < tt > TQFont::DemiBold< / tt > - 63
< li > < tt > TQFont::Bold< / tt > - 75
< li > < tt > TQFont::Black< / tt > - 87
< / ul >
< hr > < h2 > Member Function Documentation< / h2 >
< h3 class = fn > < a name = "TQFont" > < / a > TQFont::TQFont ()
< / h3 >
Constructs a font object that uses the application's default font.
< p > < p > See also < a href = "ntqapplication.html#setFont" > TQApplication::setFont< / a > () and < a href = "ntqapplication.html#font" > TQApplication::font< / a > ().
< h3 class = fn > < a name = "TQFont-2" > < / a > TQFont::TQFont ( const < a href = "tqstring.html" > TQString< / a > & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )
< / h3 >
Constructs a font object with the specified < em > family< / em > , < em > pointSize< / em > , < em > weight< / em > and < em > italic< / em > settings.
< p > If < em > pointSize< / em > is < = 0 it is set to 1.
< p > The < em > family< / em > name may optionally also include a foundry name,
e.g. "Helvetica [Cronyx]". (The TQt 2.x syntax, i.e.
"Cronyx-Helvetica", is also supported.) If the < em > family< / em > 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 = "#fontmatching" > font
matching< / a > algorithm.
< 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 = "ntqapplication.html#font" > TQApplication::font< / a > ().
< h3 class = fn > < a name = "TQFont-3" > < / a > TQFont::TQFont ( const < a href = "ntqfont.html" > TQFont< / a > & font )
< / h3 >
Constructs a font that is a copy of < em > font< / em > .
< h3 class = fn > < a name = "~TQFont" > < / a > TQFont::~TQFont ()
< / h3 >
Destroys the font object and frees all allocated resources.
< h3 class = fn > bool < a name = "bold" > < / a > TQFont::bold () const
< / h3 >
< p > Returns TRUE if < a href = "#weight" > weight< / a > () is a value greater than < a href = "#Weight-enum" > TQFont::Normal< / a > ; otherwise returns FALSE.
< p > < p > See also < a href = "#weight" > weight< / a > (), < a href = "#setBold" > setBold< / a > (), and < a href = "ntqfontinfo.html#bold" > TQFontInfo::bold< / a > ().
< p > Example: < a href = "tutorial2-09.html#x2634" > chart/optionsform.cpp< / a > .
< h3 class = fn > int < a name = "deciPointSize" > < / a > TQFont::deciPointSize () const< tt > [protected]< / tt >
< / h3 >
Returns the point size in 1/10ths of a point.
< p > The returned value will be -1 if the font size has been specified
in pixels.
< p > < p > See also < a href = "#pointSize" > pointSize< / a > () and < a href = "#pointSizeFloat" > pointSizeFloat< / a > ().
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "defaultFamily" > < / a > TQFont::defaultFamily () const
< / h3 >
Returns the family name that corresponds to the current style
hint.
< p > < p > See also < a href = "#StyleHint-enum" > StyleHint< / a > , < a href = "#styleHint" > styleHint< / a > (), and < a href = "#setStyleHint" > setStyleHint< / a > ().
< h3 class = fn > < a href = "ntqfont.html" > TQFont< / a > < a name = "defaultFont" > < / a > TQFont::defaultFont ()< tt > [static]< / tt >
< / h3 > < b > This function is obsolete.< / b > It is provided to keep old source working. We strongly advise against using it in new code.
< p > Please use < a href = "ntqapplication.html#font" > TQApplication::font< / a > () instead.
< h3 class = fn > bool < a name = "dirty" > < / a > TQFont::dirty () const< tt > [protected]< / tt >
< / h3 >
Returns TRUE if the font attributes have been changed and the font
has to be (re)loaded; otherwise returns FALSE.
< h3 class = fn > bool < a name = "exactMatch" > < / a > TQFont::exactMatch () const
< / h3 >
Returns TRUE if a window system font exactly matching the settings
of this font is available.
< p > < p > See also < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "family" > < / a > TQFont::family () const
< / h3 >
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 = "#setFamily" > setFamily< / a > (), < a href = "#substitutes" > substitutes< / a > (), and < a href = "#substitute" > substitute< / a > ().
< 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 > .
< h3 class = fn > bool < a name = "fixedPitch" > < / a > TQFont::fixedPitch () const
< / h3 >
Returns TRUE if fixed pitch has been set; otherwise returns FALSE.
< p > < p > See also < a href = "#setFixedPitch" > setFixedPitch< / a > () and < a href = "ntqfontinfo.html#fixedPitch" > TQFontInfo::fixedPitch< / a > ().
< h3 class = fn > bool < a name = "fromString" > < / a > TQFont::fromString ( const < a href = "tqstring.html" > TQString< / a > & descrip )
< / h3 >
Sets this font to match the description < em > descrip< / em > . The description
is a comma-separated list of the font attributes, as returned by
< a href = "#toString" > toString< / a > ().
< p > < p > See also < a href = "#toString" > toString< / a > () and < a href = "#operator-gt-gt" > operator> > < / a > ().
< h3 class = fn > HFONT < a name = "handle" > < / a > TQFont::handle () const
< / h3 >
Returns the window system handle to the font, for low-level
access. Using this function is < em > not< / em > portable.
< h3 class = fn > void < a name = "insertSubstitution" > < / a > TQFont::insertSubstitution ( const < a href = "tqstring.html" > TQString< / a > & familyName, const < a href = "tqstring.html" > TQString< / a > & substituteName )< tt > [static]< / tt >
< / h3 >
Inserts the family name < em > substituteName< / em > into the substitution
table for < em > familyName< / em > .
< 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 > ().
< p > Example: < a href = "simple-font-demo-example.html#x2839" > fonts/simple-qfont-demo/viewer.cpp< / a > .
< h3 class = fn > void < a name = "insertSubstitutions" > < / a > TQFont::insertSubstitutions ( const < a href = "tqstring.html" > TQString< / a > & familyName, const < a href = "tqstringlist.html" > TQStringList< / a > & substituteNames )< tt > [static]< / tt >
< / h3 >
Inserts the list of families < em > substituteNames< / em > into the
substitution list for < em > familyName< / em > .
< 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 > ().
< p > Example: < a href = "simple-font-demo-example.html#x2840" > fonts/simple-qfont-demo/viewer.cpp< / a > .
< h3 class = fn > bool < a name = "isCopyOf" > < / a > TQFont::isCopyOf ( const < a href = "ntqfont.html" > TQFont< / a > & f ) const
< / h3 >
Returns TRUE if this font and < em > f< / em > 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 = "#operator-eq" > operator=< / a > () and < a href = "#operator-eq-eq" > operator==< / a > ().
< h3 class = fn > bool < a name = "italic" > < / a > TQFont::italic () const
< / h3 >
Returns TRUE if italic has been set; otherwise returns FALSE.
< p > < p > See also < a href = "#setItalic" > setItalic< / a > ().
< p > Example: < a href = "tutorial2-09.html#x2636" > chart/optionsform.cpp< / a > .
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "key" > < / a > TQFont::key () const
< / h3 >
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 = "tqmap.html" > TQMap< / a > .
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "lastResortFamily" > < / a > TQFont::lastResortFamily () const
< / h3 >
Returns the "last resort" font family name.
< 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 a null string is returned.
< p > < p > See also < a href = "#lastResortFont" > lastResortFont< / a > ().
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "lastResortFont" > < / a > TQFont::lastResortFont () const
< / h3 >
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 > 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 > It is theoretically possible that there really isn't a
< a href = "#lastResortFont" > lastResortFont< / a > () in which case TQt 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 = "#lastResortFamily" > lastResortFamily< / a > () and < a href = "#rawName" > rawName< / a > ().
< h3 class = fn > bool < a name = "operator!-eq" > < / a > TQFont::operator!= ( const < a href = "ntqfont.html" > TQFont< / a > & f ) const
< / h3 >
Returns TRUE if this font is different from < em > f< / em > ; otherwise
returns FALSE.
< p > Two TQFonts are considered to be different if their font attributes
are different. If < a href = "#rawMode" > rawMode< / a > () is enabled for both fonts, only the
family fields are compared.
< p > < p > See also < a href = "#operator-eq-eq" > operator==< / a > ().
< h3 class = fn > < a href = "ntqfont.html" > TQFont< / a > & < a name = "operator-eq" > < / a > TQFont::operator= ( const < a href = "ntqfont.html" > TQFont< / a > & font )
< / h3 >
Assigns < em > font< / em > to this font and returns a reference to it.
< h3 class = fn > bool < a name = "operator-eq-eq" > < / a > TQFont::operator== ( const < a href = "ntqfont.html" > TQFont< / a > & f ) const
< / h3 >
Returns TRUE if this font is equal to < em > f< / em > ; otherwise returns
FALSE.
< p > Two TQFonts are considered equal if their font attributes are
equal. If < a href = "#rawMode" > rawMode< / a > () is enabled for both fonts, only the family
fields are compared.
< p > < p > See also < a href = "#operator!-eq" > operator!=< / a > () and < a href = "#isCopyOf" > isCopyOf< / a > ().
< h3 class = fn > bool < a name = "overline" > < / a > TQFont::overline () const
< / h3 >
Returns TRUE if overline has been set; otherwise returns FALSE.
< p > < p > See also < a href = "#setOverline" > setOverline< / a > ().
< h3 class = fn > int < a name = "pixelSize" > < / a > TQFont::pixelSize () const
< / h3 >
Returns the pixel size of the font if it was set with
< a href = "#setPixelSize" > setPixelSize< / a > (). Returns -1 if the size was set with < a href = "#setPointSize" > setPointSize< / a > ()
or < a href = "#setPointSizeFloat" > setPointSizeFloat< / a > ().
< p > < p > See also < a href = "#setPixelSize" > setPixelSize< / a > (), < a href = "#pointSize" > pointSize< / a > (), < a href = "ntqfontinfo.html#pointSize" > TQFontInfo::pointSize< / a > (), and < a href = "ntqfontinfo.html#pixelSize" > TQFontInfo::pixelSize< / a > ().
< h3 class = fn > int < a name = "pointSize" > < / a > TQFont::pointSize () const
< / h3 >
Returns the point size of the font. Returns -1 if the font size
was specified in pixels.
< p > < p > See also < a href = "#setPointSize" > setPointSize< / a > (), < a href = "#deciPointSize" > deciPointSize< / a > (), and < a href = "#pointSizeFloat" > pointSizeFloat< / a > ().
< 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 > .
< h3 class = fn > float < a name = "pointSizeFloat" > < / a > TQFont::pointSizeFloat () const
< / h3 >
Returns the point size of the font. Returns -1 if the font size was
specified in pixels.
< p > < p > See also < a href = "#pointSize" > pointSize< / a > (), < a href = "#setPointSizeFloat" > setPointSizeFloat< / a > (), < a href = "#pixelSize" > pixelSize< / a > (), < a href = "ntqfontinfo.html#pointSize" > TQFontInfo::pointSize< / a > (), and < a href = "ntqfontinfo.html#pixelSize" > TQFontInfo::pixelSize< / a > ().
< h3 class = fn > void < a name = "qwsRenderToDisk" > < / a > TQFont::qwsRenderToDisk ( bool all = TRUE )
< / h3 >
Saves the glyphs in the font that have previously been accessed as
a TQPF file. If < em > all< / em > is TRUE (the default), then before saving,
all glyphs are marked as used.
< p > If the font is large and you are sure that only a subset of
characters will ever be required on the target device, passing
FALSE for the < em > all< / em > parameter can save a significant amount of
disk space.
< p > Note that this function is only applicable on TQt/Embedded.
< h3 class = fn > bool < a name = "rawMode" > < / a > TQFont::rawMode () const
< / h3 >
Returns TRUE if raw mode is used for font name matching; otherwise
returns FALSE.
< p > < p > See also < a href = "#setRawMode" > setRawMode< / a > () and < a href = "#rawName" > rawName< / a > ().
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "rawName" > < / a > TQFont::rawName () const
< / h3 >
Returns the name of the font within the underlying window system.
< p > On Windows, this is usually just the family name of a TrueType
font.
< p > On X11, it is an XLFD (X Logical Font Description). When TQt is
build with Xft support on X11, the return value can be an Xft
pattern or an XLFD.
< p > Using the return value of this function is usually < em > not< / em > < em > portable< / em > .
< p > < p > See also < a href = "#setRawName" > setRawName< / a > ().
< h3 class = fn > void < a name = "removeSubstitution" > < / a > TQFont::removeSubstitution ( const < a href = "tqstring.html" > TQString< / a > & familyName )< tt > [static]< / tt >
< / h3 >
Removes all the substitutions for < em > familyName< / em > .
< 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 > ().
< h3 class = fn > < a href = "ntqfont.html" > TQFont< / a > < a name = "resolve" > < / a > TQFont::resolve ( const < a href = "ntqfont.html" > TQFont< / a > & other ) const
< / h3 >
Returns a new TQFont that has attributes copied from < em > other< / em > .
< h3 class = fn > void < a name = "setBold" > < / a > TQFont::setBold ( bool enable )
< / h3 >
< p > If < em > enable< / em > is true sets the font's weight to < a href = "#Weight-enum" > TQFont::Bold< / a > ; otherwise sets the weight to < a href = "#Weight-enum" > TQFont::Normal< / a > .
< p > For finer boldness control use < a href = "#setWeight" > setWeight< / a > ().
< p > < p > See also < a href = "#bold" > bold< / a > () and < a href = "#setWeight" > setWeight< / a > ().
< p > Examples: < a href = "menu-example.html#x1860" > menu/menu.cpp< / a > and < a href = "themes-example.html#x280" > themes/metal.cpp< / a > .
< h3 class = fn > void < a name = "setDefaultFont" > < / a > TQFont::setDefaultFont ( const < a href = "ntqfont.html" > TQFont< / a > & f )< tt > [static]< / tt >
< / h3 > < b > This function is obsolete.< / b > It is provided to keep old source working. We strongly advise against using it in new code.
< p > Please use < a href = "ntqapplication.html#setFont" > TQApplication::setFont< / a > () instead.
< h3 class = fn > void < a name = "setFamily" > < / a > TQFont::setFamily ( const < a href = "tqstring.html" > TQString< / a > & family )
< / h3 >
Sets the family name of the font. The name is case insensitive and
may include a foundry name.
< p > The < em > family< / em > name may optionally also include a foundry name,
e.g. "Helvetica [Cronyx]". (The TQt 2.x syntax, i.e.
"Cronyx-Helvetica", is also supported.) If the < em > family< / em > 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 = "#fontmatching" > font
matching< / a > algorithm.
< p > < p > See also < a href = "#family" > family< / a > (), < a href = "#setStyleHint" > setStyleHint< / a > (), and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< h3 class = fn > void < a name = "setFixedPitch" > < / a > TQFont::setFixedPitch ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, sets fixed pitch on; otherwise sets fixed
pitch off.
< p > < p > See also < a href = "#fixedPitch" > fixedPitch< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< h3 class = fn > void < a name = "setItalic" > < / a > TQFont::setItalic ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, italic is set on; otherwise italic is set
off.
< p > < p > See also < a href = "#italic" > italic< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< 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 > .
< h3 class = fn > void < a name = "setOverline" > < / a > TQFont::setOverline ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, sets overline on; otherwise sets overline off.
< p > < p > See also < a href = "#overline" > overline< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< h3 class = fn > void < a name = "setPixelSize" > < / a > TQFont::setPixelSize ( int pixelSize )
< / h3 >
Sets the font size to < em > pixelSize< / em > pixels.
< p > Using this function makes the font device dependent. Use
< a href = "#setPointSize" > setPointSize< / a > () or < a href = "#setPointSizeFloat" > setPointSizeFloat< / a > () to set the size of the font
in a device independent manner.
< p > < p > See also < a href = "#pixelSize" > pixelSize< / a > ().
< p > Example: < a href = "qwerty-example.html#x367" > qwerty/qwerty.cpp< / a > .
< h3 class = fn > void < a name = "setPixelSizeFloat" > < / a > TQFont::setPixelSizeFloat ( float pixelSize )
< / h3 > < b > This function is obsolete.< / b > It is provided to keep old source working. We strongly advise against using it in new code.
< p > Sets the logical pixel height of font characters when shown on
the screen to < em > pixelSize< / em > .
< h3 class = fn > void < a name = "setPointSize" > < / a > TQFont::setPointSize ( int pointSize )
< / h3 >
Sets the point size to < em > pointSize< / em > . The point size must be
greater than zero.
< p > < p > See also < a href = "#pointSize" > pointSize< / a > () and < a href = "#setPointSizeFloat" > setPointSizeFloat< / a > ().
< p > Example: < a href = "simple-font-demo-example.html#x2843" > fonts/simple-qfont-demo/viewer.cpp< / a > .
< h3 class = fn > void < a name = "setPointSizeFloat" > < / a > TQFont::setPointSizeFloat ( float pointSize )
< / h3 >
Sets the point size to < em > pointSize< / em > . The point size must be
greater than zero. The requested precision may not be achieved on
all platforms.
< p > < p > See also < a href = "#pointSizeFloat" > pointSizeFloat< / a > (), < a href = "#setPointSize" > setPointSize< / a > (), and < a href = "#setPixelSize" > setPixelSize< / a > ().
< h3 class = fn > void < a name = "setRawMode" > < / a > TQFont::setRawMode ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, turns raw mode on; otherwise turns raw mode
off. This function only has an effect under X11.
< p > If raw mode is enabled, TQt will search for an X font with a
complete font name matching the family name, ignoring all other
values set for the TQFont. If the font name matches several fonts,
TQt will use the first font returned by X. < a href = "ntqfontinfo.html" > TQFontInfo< / a > < em > cannot< / em > be
used to fetch information about a TQFont using raw mode (it will
return the values set in the TQFont for all parameters, including
the family name).
< p > < b > Warning:< / b > Do not use raw mode unless you really, really need it! In
most (if not all) cases, < a href = "#setRawName" > setRawName< / a > () is a much better choice.
< p > < p > See also < a href = "#rawMode" > rawMode< / a > () and < a href = "#setRawName" > setRawName< / a > ().
< h3 class = fn > void < a name = "setRawName" > < / a > TQFont::setRawName ( const < a href = "tqstring.html" > TQString< / a > & name )
< / h3 >
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 < em > name< / em > to this
function.
< p > A font set with < a href = "#setRawName" > setRawName< / a > () is still a full-featured TQFont. It can
be queried (for example with < a href = "#italic" > italic< / a > ()) or modified (for example with
< a href = "#setItalic" > setItalic< / a > ()) and is therefore also suitable for rendering rich text.
< p > If TQt's internal font database cannot resolve the raw name, the
font becomes a raw font with < em > name< / em > as its family.
< 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 = "#rawName" > rawName< / a > (), < a href = "#setRawMode" > setRawMode< / a > (), and < a href = "#setFamily" > setFamily< / a > ().
< h3 class = fn > void < a name = "setStretch" > < / a > TQFont::setStretch ( int factor )
< / h3 >
Sets the < a href = "layout.html#stretch-factor" > stretch factor< / a > for the font.
< p > The stretch factor changes the width of all characters in the font
by < em > factor< / em > percent. For example, setting < em > factor< / em > 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 > The stretch factor is only applied to outline fonts. The stretch
factor is ignored for bitmap fonts.
< p > NOTE: TQFont 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 = "#stretch" > stretch< / a > () and < a href = "#StyleStrategy-enum" > TQFont::StyleStrategy< / a > .
< h3 class = fn > void < a name = "setStrikeOut" > < / a > TQFont::setStrikeOut ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, sets strikeout on; otherwise sets strikeout
off.
< p > < p > See also < a href = "#strikeOut" > strikeOut< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< h3 class = fn > void < a name = "setStyleHint" > < / a > TQFont::setStyleHint ( < a href = "ntqfont.html#StyleHint-enum" > StyleHint< / a > hint, < a href = "ntqfont.html#StyleStrategy-enum" > StyleStrategy< / a > strategy = PreferDefault )
< / h3 >
Sets the style hint and strategy to < em > hint< / em > and < em > strategy< / em > ,
respectively.
< p > If these aren't set explicitly the style hint will default to
< a href = "#StyleHint-enum" > AnyStyle< / a > and the style strategy to < a href = "#StyleStrategy-enum" > PreferDefault< / a > .
< p > TQt does not support style hints on X11 since this information
is not provided by the window system.
< 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 = "ntqfontinfo.html" > TQFontInfo< / a > .
< 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 > .
< h3 class = fn > void < a name = "setStyleStrategy" > < / a > TQFont::setStyleStrategy ( < a href = "ntqfont.html#StyleStrategy-enum" > StyleStrategy< / a > s )
< / h3 >
Sets the style strategy for the font to < em > s< / em > .
< p > < p > See also < a href = "#StyleStrategy-enum" > TQFont::StyleStrategy< / a > .
< h3 class = fn > void < a name = "setUnderline" > < / a > TQFont::setUnderline ( bool enable )
< / h3 >
If < em > enable< / em > is TRUE, sets underline on; otherwise sets underline
off.
< p > < p > See also < a href = "#underline" > underline< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< 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 > .
< h3 class = fn > void < a name = "setWeight" > < / a > TQFont::setWeight ( int weight )
< / h3 >
Sets the weight the font to < em > weight< / em > , which should be a value
from the < a href = "#Weight-enum" > TQFont::Weight< / a > enumeration.
< p > < p > See also < a href = "#weight" > weight< / a > () and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< p > Example: < a href = "simple-font-demo-example.html#x2846" > fonts/simple-qfont-demo/viewer.cpp< / a > .
< h3 class = fn > int < a name = "stretch" > < / a > TQFont::stretch () const
< / h3 >
Returns the < a href = "layout.html#stretch-factor" > stretch factor< / a > for the font.
< p > < p > See also < a href = "#setStretch" > setStretch< / a > ().
< h3 class = fn > bool < a name = "strikeOut" > < / a > TQFont::strikeOut () const
< / h3 >
Returns TRUE if strikeout has been set; otherwise returns FALSE.
< p > < p > See also < a href = "#setStrikeOut" > setStrikeOut< / a > ().
< h3 class = fn > < a href = "ntqfont.html#StyleHint-enum" > StyleHint< / a > < a name = "styleHint" > < / a > TQFont::styleHint () const
< / h3 >
Returns the StyleHint.
< p > The style hint affects the < a href = "#fontmatching" > font
matching< / a > algorithm. See < a href = "#StyleHint-enum" > TQFont::StyleHint< / a > for the list
of strategies.
< p > < p > See also < a href = "#setStyleHint" > setStyleHint< / a > (), < a href = "#StyleStrategy-enum" > TQFont::StyleStrategy< / a > , and < a href = "ntqfontinfo.html#styleHint" > TQFontInfo::styleHint< / a > ().
< h3 class = fn > < a href = "ntqfont.html#StyleStrategy-enum" > StyleStrategy< / a > < a name = "styleStrategy" > < / a > TQFont::styleStrategy () const
< / h3 >
Returns the StyleStrategy.
< p > The style strategy affects the < a href = "#fontmatching" > font
matching< / a > algorithm. See < a href = "#StyleStrategy-enum" > TQFont::StyleStrategy< / a > for the
list of strategies.
< p > < p > See also < a href = "#setStyleHint" > setStyleHint< / a > () and < a href = "#StyleHint-enum" > TQFont::StyleHint< / a > .
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "substitute" > < / a > TQFont::substitute ( const < a href = "tqstring.html" > TQString< / a > & familyName )< tt > [static]< / tt >
< / h3 >
Returns the first family name to be used whenever < em > familyName< / em > is
specified. The lookup is case insensitive.
< p > If there is no substitution for < em > familyName< / em > , < em > familyName< / em > is
returned.
< p > To obtain a list of substitutions use < a href = "#substitutes" > substitutes< / a > ().
< 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 > ().
< h3 class = fn > < a href = "tqstringlist.html" > TQStringList< / a > < a name = "substitutes" > < / a > TQFont::substitutes ( const < a href = "tqstring.html" > TQString< / a > & familyName )< tt > [static]< / tt >
< / h3 >
Returns a list of family names to be used whenever < em > familyName< / em >
is specified. The lookup is case insensitive.
< p > If there is no substitution for < em > familyName< / em > , an empty list is
returned.
< 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 > ().
< p > Example: < a href = "simple-font-demo-example.html#x2847" > fonts/simple-qfont-demo/viewer.cpp< / a > .
< h3 class = fn > < a href = "tqstringlist.html" > TQStringList< / a > < a name = "substitutions" > < / a > TQFont::substitutions ()< tt > [static]< / tt >
< / h3 >
Returns a sorted list of substituted family names.
< p > < p > See also < a href = "#insertSubstitution" > insertSubstitution< / a > (), < a href = "#removeSubstitution" > removeSubstitution< / a > (), and < a href = "#substitute" > substitute< / a > ().
< h3 class = fn > < a href = "tqstring.html" > TQString< / a > < a name = "toString" > < / a > TQFont::toString () const
< / h3 >
Returns a description of the font. The description is a
comma-separated list of the attributes, perfectly suited for use
in < a href = "ntqsettings.html" > TQSettings< / a > .
< p > < p > See also < a href = "#fromString" > fromString< / a > () and < a href = "#operator-lt-lt" > operator< < < / a > ().
< h3 class = fn > bool < a name = "underline" > < / a > TQFont::underline () const
< / h3 >
Returns TRUE if underline has been set; otherwise returns FALSE.
< p > < p > See also < a href = "#setUnderline" > setUnderline< / a > ().
< h3 class = fn > int < a name = "weight" > < / a > TQFont::weight () const
< / h3 >
Returns the weight of the font which is one of the enumerated
values from < a href = "#Weight-enum" > TQFont::Weight< / a > .
< p > < p > See also < a href = "#setWeight" > setWeight< / a > (), < a href = "#Weight-enum" > Weight< / a > , and < a href = "ntqfontinfo.html" > TQFontInfo< / a > .
< hr > < h2 > Related Functions< / h2 >
< h3 class = fn > < a href = "ntqdatastream.html" > TQDataStream< / a > & < a name = "operator-lt-lt" > < / a > operator< < ( < a href = "ntqdatastream.html" > TQDataStream< / a > & s, const < a href = "ntqfont.html" > TQFont< / a > & font )
< / h3 >
< p > Writes the font < em > font< / em > to the data stream < em > s< / em > . (< a href = "#toString" > toString< / a > ()
writes to a text stream.)
< p > < p > See also < a href = "datastreamformat.html" > Format of the TQDataStream operators< / a > .
< h3 class = fn > < a href = "ntqdatastream.html" > TQDataStream< / a > & < a name = "operator-gt-gt" > < / a > operator> > ( < a href = "ntqdatastream.html" > TQDataStream< / a > & s, < a href = "ntqfont.html" > TQFont< / a > & font )
< / h3 >
< p > Reads the font < em > font< / em > from the data stream < em > s< / em > . (< a href = "#fromString" > fromString< / a > ()
reads from a text stream.)
< p > < p > See also < a href = "datastreamformat.html" > Format of the TQDataStream operators< / a > .
<!-- eof -->
< hr > < p >
This file is part of the < a href = "index.html" > TQt toolkit< / a > .
Copyright © 1995-2007
< a href = "http://www.trolltech.com/" > Trolltech< / a > . All Rights Reserved.< p > < address > < hr > < div align = center >
< table width = 100% cellspacing = 0 border = 0 > < tr >
< td > Copyright © 2007
< a href = "troll.html" > Trolltech< / a > < td align = center > < a href = "trademarks.html" > Trademarks< / a >
< td align = right > < div align = right > TQt 3.3.8< / div >
< / table > < / div > < / address > < / body >
< / html >