⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qfont.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 3 页
字号:
'\" t.TH QFont 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQFont \- Font used for drawing text.SH SYNOPSIS\fC#include <qfont.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBStyleHint\fR { Helvetica, SansSerif = Helvetica, Times, Serif = Times, Courier, TypeWriter = Courier, OldEnglish, Decorative = OldEnglish, System, AnyStyle }".br.ti -1c.BI "enum \fBStyleStrategy\fR { PreferDefault = 0x0001, PreferBitmap = 0x0002, PreferDevice = 0x0004, PreferOutline = 0x0008, ForceOutline = 0x0010, PreferMatch = 0x0020, PreferQuality = 0x0040, PreferAntialias = 0x0080, NoAntialias = 0x0100 }".br.ti -1c.BI "enum \fBWeight\fR { Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }".br.ti -1c.BI "\fBQFont\fR ()".br.ti -1c.BI "\fBQFont\fR ( const QString & family, int pointSize = 12, int weight = Normal, bool italic = FALSE )".br.ti -1c.BI "\fBQFont\fR ( const QFont & font )".br.ti -1c.BI "\fB~QFont\fR ()".br.ti -1c.BI "QString \fBfamily\fR () const".br.ti -1c.BI "void \fBsetFamily\fR ( const QString & family )".br.ti -1c.BI "int \fBpointSize\fR () const".br.ti -1c.BI "float \fBpointSizeFloat\fR () const".br.ti -1c.BI "void \fBsetPointSize\fR ( int pointSize )".br.ti -1c.BI "void \fBsetPointSizeFloat\fR ( float pointSize )".br.ti -1c.BI "int \fBpixelSize\fR () const".br.ti -1c.BI "void \fBsetPixelSize\fR ( int pixelSize )".br.ti -1c.BI "void setPixelSizeFloat ( float pixelSize )  \fI(obsolete)\fR".br.ti -1c.BI "int \fBweight\fR () const".br.ti -1c.BI "void \fBsetWeight\fR ( int weight )".br.ti -1c.BI "bool \fBbold\fR () const".br.ti -1c.BI "void \fBsetBold\fR ( bool enable )".br.ti -1c.BI "bool \fBitalic\fR () const".br.ti -1c.BI "void \fBsetItalic\fR ( bool enable )".br.ti -1c.BI "bool \fBunderline\fR () const".br.ti -1c.BI "void \fBsetUnderline\fR ( bool enable )".br.ti -1c.BI "bool \fBstrikeOut\fR () const".br.ti -1c.BI "void \fBsetStrikeOut\fR ( bool enable )".br.ti -1c.BI "bool \fBfixedPitch\fR () const".br.ti -1c.BI "void \fBsetFixedPitch\fR ( bool enable )".br.ti -1c.BI "StyleHint \fBstyleHint\fR () const".br.ti -1c.BI "StyleStrategy \fBstyleStrategy\fR () const".br.ti -1c.BI "void \fBsetStyleHint\fR ( StyleHint hint, StyleStrategy strategy = PreferDefault )".br.ti -1c.BI "void \fBsetStyleStrategy\fR ( StyleStrategy s )".br.ti -1c.BI "bool \fBrawMode\fR () const".br.ti -1c.BI "void \fBsetRawMode\fR ( bool enable )".br.ti -1c.BI "bool \fBexactMatch\fR () const".br.ti -1c.BI "QFont & \fBoperator=\fR ( const QFont & font )".br.ti -1c.BI "bool \fBoperator==\fR ( const QFont & f ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QFont & f ) const".br.ti -1c.BI "bool \fBisCopyOf\fR ( const QFont & f ) const".br.ti -1c.BI "HFONT \fBhandle\fR () const".br.ti -1c.BI "void \fBsetRawName\fR ( const QString & name )".br.ti -1c.BI "QString \fBrawName\fR () const".br.ti -1c.BI "QString \fBkey\fR () const".br.ti -1c.BI "QString \fBtoString\fR () const".br.ti -1c.BI "bool \fBfromString\fR ( const QString & descrip )".br.ti -1c.BI "void \fBqwsRenderToDisk\fR ( bool all = TRUE )".br.ti -1c.BI "enum \fBScript\fR { 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, NScripts, UnknownScript = NScripts, NoScript, HanX11, LatinBasic = Latin, LatinExtendedA_2 = HanX11 + 1, LatinExtendedA_3, LatinExtendedA_4, LatinExtendedA_14, LatinExtendedA_15, KatakanaHalfWidth, LastPrivateScript }".br.ti -1c.BI "QString \fBdefaultFamily\fR () const".br.ti -1c.BI "QString \fBlastResortFamily\fR () const".br.ti -1c.BI "QString \fBlastResortFont\fR () const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QString \fBsubstitute\fR ( const QString & familyName )".br.ti -1c.BI "QStringList \fBsubstitutes\fR ( const QString & familyName )".br.ti -1c.BI "QStringList \fBsubstitutions\fR ()".br.ti -1c.BI "void \fBinsertSubstitution\fR ( const QString & familyName, const QString & substituteName )".br.ti -1c.BI "void \fBinsertSubstitutions\fR ( const QString & familyName, const QStringList & substituteNames )".br.ti -1c.BI "void \fBremoveSubstitution\fR ( const QString & familyName )".br.ti -1c.BI "QFont defaultFont ()  \fI(obsolete)\fR".br.ti -1c.BI "void setDefaultFont ( const QFont & f )  \fI(obsolete)\fR".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "bool \fBdirty\fR () const".br.ti -1c.BI "int \fBdeciPointSize\fR () const".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QFont & font )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QFont & font )".br.in -1c.SH DESCRIPTIONThe QFont class specifies a font used for drawing text..PPWhen you create a QFont object you specify various attributes that you want the font to have. Qt will use the font with the specified attributes, or if no matching font exists, Qt will use the closest matching installed font. The attributes of the font that is actually used are retrievable from a QFontInfo object. If the window system provides an exact match exactMatch() returns TRUE. Use QFontMetrics to get measurements, e.g. the pixel length of a string using QFontMetrics::width()..PPUse QApplication::setFont() to set the application's default font..PPIf a choosen X11 font does not include all the characters that need to be displayed, QFont will try to find the characters in the nearest equivalent fonts. When a QPainter draws a character from a font the QFont will report whether or not it has the character; if it does not, QPainter will draw an unfilled square..PPCreate QFonts like this:.PP.nf.br    QFont serifFont( "Times", 10, Bold );.br    QFont sansFont( "Helvetica [Cronyx]", 12 );.br.fi.PPThe attributes set in the constructor can also be set later, e.g. setFamily(), setPointSize(), setPointSizeFloat(), setWeight() and setItalic(). The remaining attributes must be set after contstruction, e.g. setBold(), setUnderline(), setStrikeOut() and setFixedPitch(). QFontInfo objects should be created \fIafter\fR the font's attributes have been set. A QFontInfo object will not change, even if you change the font's attributes. The corresponding "get" functions, e.g. family(), pointSize(), etc., return the values that were set, even though the values used may differ. The actual values are available from a QFontInfo object..PPIf the requested font family is unavailable you can influence the font matching algorithm by choosing a particular QFont::StyleHint and QFont::StyleStrategy with setStyleHint(). The default family (corresponding to the current style hint) is returned by defaultFamily()..PPThe font-matching algorithm has a lastResortFamily() and lastResortFont() in cases where a suitable match cannot be found. You can provide substitutions for font family names using insertSubstitution() and insertSubstitutions(). Substitutions can be removed with removeSubstitution(). Use substitute() to retrieve a family's first substitute, or the family name itself if it has no substitutes. Use substitutes() to retrieve a list of a family's substitutes (which may be empty)..PPEvery QFont has a key() 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 QSettings, writing the font information with toString() and reading it back with fromString(). The operator<<() and operator>>() functions are also available, but they work on a data stream..PPIt is possible to set the height of characters shown on the screen to a specified number of pixels with setPixelSize(); however using setPointSize() has a similar effect and provides device independence..PPUnder the X Window System you can set a font using its system specific name with setRawName()..PPLoading fonts can be expensive, especially on X11. QFont contains extensive optimizations to make the copying of QFont objects fast, and to cache the results of the slow window system functions it depends upon..PPThe font matching algorithm works as follows: <ol type=1>.IP 1The specified font family is searched for..IP 2If not found, the styleHint() is used to select a replacement family..IP 3Each replacement font family is searched for..IP 4If none of these are found or there was no styleHint(), "helvetica" will be searched for..IP 5If "helvetica" isn't found Qt will try the lastResortFamily()..IP 6If the lastResortFamily() isn't found Qt will try the lastResortFont() which will always return a name of some kind..PPOnce a font is found, the remaining attributes are matched in order of priority: <ol type=1>.IP 7fixedPitch().IP 8pointSize() (see below).IP 9weight().IP 10italic().PPIf 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..PPThe 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..PPThe 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 QFontInfo object can be used to determine the actual values used for drawing the text..PPExamples:.)l.PP.nf.br    QFont f("Helvetica");.br.fi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -