qfont-h.html

来自「qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人」· HTML 代码 · 共 292 行

HTML
292
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Qt Toolkit - qfont.h include file</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }--></style></head><body bgcolor="#ffffff"><table width="100%"><tr><td><a href="index.html"><img width="100" height="100" src="qtlogo.png"alt="Home" border="0"><img width="100"height="100" src="face.png" alt="Home" border="0"></a><td valign="top"><div align="right"><img src="dochead.png" width="472" height="27"><br><a href="classes.html"><b>Classes</b></a>- <a href="annotated.html">Annotated</a>- <a href="hierarchy.html">Tree</a>- <a href="functions.html">Functions</a>- <a href="index.html">Home</a>- <a href="topicals.html"><b>Structure</b>  <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qte</font></a></div></table><h1 align=center>qfont.h</h1><br clear="all">This is the verbatim text of the qfont.h include file.  It isprovided only for illustration; the copyrightremains with Trolltech.<hr><pre>/****************************************************************************** &#36;Id&#58; qt/src/kernel/qfont.h   2.3.8   edited 2004-05-12 $**** Definition of QFont class**** Created : 940514**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the kernel module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#ifndef QFONT_H#define QFONT_H#ifndef QT_H#include "qwindowdefs.h"#include "qstring.h"#endif // QT_Hclass <a href="qstringlist.html">QStringList</a>;struct QFontDef;struct QFontData;class QFontInternal;class QRenderedFont;class Q_EXPORT <a href="qfont.html">QFont</a>                                    // font class{public:    enum CharSet   { ISO_8859_1,  Latin1 = ISO_8859_1, AnyCharSet,                     ISO_8859_2,  Latin2 = ISO_8859_2,                     ISO_8859_3,  Latin3 = ISO_8859_3,                     ISO_8859_4,  Latin4 = ISO_8859_4,                     ISO_8859_5,                     ISO_8859_6,                     ISO_8859_7,                     ISO_8859_8,                     ISO_8859_9,  Latin5 = ISO_8859_9,                     ISO_8859_10, Latin6 = ISO_8859_10,                     ISO_8859_11, TIS620 = ISO_8859_11,                     ISO_8859_12,                     ISO_8859_13, Latin7 = ISO_8859_13,                     ISO_8859_14, Latin8 = ISO_8859_14,                     ISO_8859_15, Latin9 = ISO_8859_15,                     KOI8R,                     Set_Ja, Set_1 = Set_Ja,                     Set_Ko,                     Set_Th_TH,                     Set_Zh,                     Set_Zh_TW,                     Set_N = Set_Zh_TW,                     Unicode,                     /* The following will need to be re-ordered later,                        since we accidentally left no room below "Unicode".                        (For binary-compatibility that cannot change yet).                        The above will be obsoleted and a same-named list                        added below.                     */                     Set_GBK,                     Set_Big5,                     TSCII,                     KOI8U,                     CP1251,                     PT154,                     /* The following are font-specific encodings that                        we shouldn't need in a perfect world.                     */                     // 8-bit fonts                     JIS_X_0201 = 0xa0,                     // 16-bit fonts                     JIS_X_0208 = 0xc0, Enc16 = JIS_X_0208,                     KSC_5601,                     GB_2312,                     Big5    };    enum StyleHint { Helvetica, Times, Courier, OldEnglish,  System, AnyStyle,                     SansSerif  = Helvetica,                     Serif      = Times,                     TypeWriter = Courier,                     Decorative = OldEnglish};    enum StyleStrategy { PreferDefault = 0x0001,                          PreferBitmap = 0x0002,                          PreferDevice = 0x0004,                          PreferOutline = 0x0008,                          ForceOutline = 0x0010,                          PreferMatch = 0x0020,                          PreferQuality = 0x0040 };    enum Weight    { Light = 25, Normal = 50, DemiBold = 63,                     Bold  = 75, Black  = 87 };    QFont();                                    // default font    QFont( const QString &amp;family, int pointSize = 12,           int weight = Normal, bool italic = FALSE );    QFont( const QString &amp;family, int pointSize,           int weight, bool italic, CharSet charSet );    QFont( const QFont &amp; );    ~QFont();    QFont      &amp;operator=( const QFont &amp; );    QString     family()        const;    void        setFamily( const QString &amp;);    int         pointSize()     const;    float       pointSizeFloat()        const;    void        setPointSize( int );    void        setPointSizeFloat( float );    int         pixelSize() const;    void        setPixelSize( int );    void        setPixelSizeFloat( float );    int         weight()        const;    void        setWeight( int );    bool        bold()          const;    void        setBold( bool );    bool        italic()        const;    void        setItalic( bool );    bool        underline()     const;    void        setUnderline( bool );    bool        strikeOut()     const;    void        setStrikeOut( bool );    bool        fixedPitch()    const;    void        setFixedPitch( bool );    StyleHint   styleHint()     const;    void        setStyleHint( StyleHint );    StyleStrategy styleStrategy() const;    void        setStyleHint( StyleHint, StyleStrategy );    CharSet     charSet()       const;    void        setCharSet( CharSet );    static CharSet charSetForLocale();    bool        rawMode()      const;    void        setRawMode( bool );    bool        exactMatch()    const;    bool        operator==( const QFont &amp; ) const;    bool        operator!=( const QFont &amp; ) const;    bool        isCopyOf( const QFont &amp; ) const;#if defined(_WS_WIN_)    HFONT       handle() const;#elif defined(_WS_MAC_)    HANDLE      handle() const;#elif defined(_WS_X11_)    HANDLE      handle() const;#elif defined(_WS_QWS_)    HANDLE      handle() const;#endif    void        setRawName( const QString &amp; );    QString     rawName() const;    QString     key() const;    static QString encodingName( CharSet );    static QFont defaultFont();    static void setDefaultFont( const QFont &amp; );    static QString substitute( const QString &amp;familyName );    static void insertSubstitution( const QString&amp;, const QString &amp;);    static void removeSubstitution( const QString &amp;);    static QStringList substitutions();    static void initialize();    static void locale_init();    static void cleanup();    static void cacheStatistics();#if defined(_WS_QWS_)    void qwsRenderToDisk(bool all=TRUE);#endifprotected:    bool        dirty()                 const;    QString     defaultFamily()         const;    QString     lastResortFamily()      const;    QString     lastResortFont()        const;    int         deciPointSize()         const;private:    QFont( QFontData * );    void        init();    void        detach();    void        initFontInfo() const;    void        load() const;#if defined(_WS_MAC_)    void        macSetFont(void *);#endif#if defined(_WS_WIN_)    HFONT       create( bool *, HDC=0, bool=FALSE ) const;    void       *textMetric() const;#endif    friend class QFont_Private;    friend class QFontInternal;    friend class QFontMetrics;    friend class QFontInfo;    friend class QPainter;#if defined(_WS_X11_) &amp;&amp; defined(QT_XFT)    friend void * qt_ft_font (const QFont *f);#endif#ifndef QT_NO_DATASTREAM    friend Q_EXPORT QDataStream &amp;operator&lt;&lt;( QDataStream &amp;, const QFont &amp; );    friend Q_EXPORT QDataStream &amp;operator&gt;&gt;( QDataStream &amp;, QFont &amp; );#endif    QFontData    *d;                            // internal font data    static CharSet defaultCharSet;};inline bool QFont::bold() const{ return weight() &gt; Normal; }inline void QFont::setBold( bool enable ){ setWeight( enable ? Bold : Normal ); }/*****************************************************************************  QFont stream functions *****************************************************************************/#ifndef QT_NO_DATASTREAMQ_EXPORT QDataStream &amp;operator&lt;&lt;( QDataStream &amp;, const QFont &amp; );Q_EXPORT QDataStream &amp;operator&gt;&gt;( QDataStream &amp;, QFont &amp; );#endif#endif // QFONT_H</pre><p><address><hr><div align="center"><table width="100%" cellspacing="0" border="0"><tr><td>Copyright 

⌨️ 快捷键说明

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