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

📄 qfontengine_p.h

📁 linux下聊天室的稳定版本
💻 H
📖 第 1 页 / 共 2 页
字号:
    Error stringToCMap( const QChar *str,  int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const;    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );    virtual glyph_metrics_t boundingBox( const glyph_t *glyphs,				    const advance_t *advances, const qoffset_t *offsets, int numGlyphs );    glyph_metrics_t boundingBox( glyph_t glyph );    int ascent() const;    int descent() const;    int leading() const;    int lineThickness() const;    int underlinePosition() const;    int maxCharWidth() const;    int minLeftBearing() const;    int minRightBearing() const;    int cmap() const;    const char *name() const;    void setScale( double scale );    double scale() const { return _scale; }    bool canRender( const QChar *string,  int len );    Type type() const;    XftPattern *pattern() const { return _pattern; }    FT_Face face() const { return _face; }    XftFont *font() const { return _font; }    void recalcAdvances( int len, glyph_t *glyphs, advance_t *advances );private:    friend class QFontPrivate;    friend class QOpenType;    XftFont *_font;    XftPattern *_pattern;    FT_Face _face;    QOpenType *_openType;    int _cmap;    short lbearing;    short rbearing;    float _scale;    enum { widthCacheSize = 0x800, cmapCacheSize = 0x500 };    unsigned char widthCache[widthCacheSize];    glyph_t cmapCache[cmapCacheSize];};#endifclass QFontEngineLatinXLFD;class QFontEngineXLFD : public QFontEngine{public:    QFontEngineXLFD( XFontStruct *fs, const char *name, int cmap );    ~QFontEngineXLFD();    Error stringToCMap( const QChar *str,  int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const;    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );    virtual glyph_metrics_t boundingBox( const glyph_t *glyphs,				    const advance_t *advances, const qoffset_t *offsets, int numGlyphs );    glyph_metrics_t boundingBox( glyph_t glyph );    int ascent() const;    int descent() const;    int leading() const;    int maxCharWidth() const;    int minLeftBearing() const;    int minRightBearing() const;    int cmap() const;    const char *name() const;    bool canRender( const QChar *string,  int len );    void setScale( double scale );    double scale() const { return _scale; }    Type type() const;    Qt::HANDLE handle() const { return (Qt::HANDLE) _fs->fid; }private:    friend class QFontPrivate;    XFontStruct *_fs;    QCString _name;    QTextCodec *_codec;    float _scale; // needed for printing, to correctly scale font metrics for bitmap fonts    int _cmap;    short lbearing;    short rbearing;    enum XlfdTransformations {	XlfdTrUnknown,	XlfdTrSupported,	XlfdTrUnsupported    };    XlfdTransformations xlfd_transformations;    friend class QFontEngineLatinXLFD;};class QFontEngineLatinXLFD : public QFontEngine{public:    QFontEngineLatinXLFD( XFontStruct *xfs, const char *name, int cmap );    ~QFontEngineLatinXLFD();    Error stringToCMap( const QChar *str,  int len, glyph_t *glyphs,			advance_t *advances, int *nglyphs, bool mirrored ) const;    void draw( QPainter *p, int x, int y, const QTextEngine *engine,	       const QScriptItem *si, int textFlags );    virtual glyph_metrics_t boundingBox( const glyph_t *glyphs,					 const advance_t *advances,					 const qoffset_t *offsets, int numGlyphs );    glyph_metrics_t boundingBox( glyph_t glyph );    int ascent() const;    int descent() const;    int leading() const;    int maxCharWidth() const;    int minLeftBearing() const;    int minRightBearing() const;    int cmap() const { return -1; } // ###    const char *name() const;    bool canRender( const QChar *string,  int len );    void setScale( double scale );    double scale() const { return _engines[0]->scale(); }    Type type() const { return LatinXLFD; }    Qt::HANDLE handle() const { return ((QFontEngineXLFD *) _engines[0])->handle(); }private:    void findEngine( const QChar &ch );    QFontEngine **_engines;    int _count;    glyph_t   glyphIndices [0x200];    advance_t glyphAdvances[0x200];    glyph_t euroIndex;    advance_t euroAdvance;};class QScriptItem;class QTextEngine;#ifndef QT_NO_XFTFREETYPE#include "qscriptengine_p.h"#include "qtextengine_p.h"#include <ft2build.h>#include FT_FREETYPE_H#include "ftxopen.h"enum { PositioningProperties = 0x80000000 };class QOpenType{public:    QOpenType(QFontEngineXft *fe);    ~QOpenType();    struct Features {        uint tag;        uint property;    };    bool supportsScript(unsigned int script) {        Q_ASSERT(script < QFont::NScripts);        return supported_scripts[script];    }    void selectScript(unsigned int script, const Features *features = 0);        bool shape(QShaperItem *item, const unsigned int *properties = 0);    bool positionAndAdd(QShaperItem *item, bool doLogClusters = TRUE);    OTL_GlyphItem glyphs() const { return otl_buffer->in_string; }    int len() const { return otl_buffer->in_length; }    void setProperty(int index, uint property) { otl_buffer->in_string[index].properties = property; }private:     bool checkScript(unsigned int script);    QFontEngine *fontEngine;    FT_Face face;    TTO_GDEF gdef;    TTO_GSUB gsub;    TTO_GPOS gpos;    bool supported_scripts[QFont::NScripts];    FT_ULong current_script;    bool positioned : 1;    OTL_Buffer otl_buffer;    GlyphAttributes *tmpAttributes;    unsigned int *tmpLogClusters;    int length;    int orig_nglyphs;    int loadFlags;};#endif // QT_NO_XFTFREETYPE#elif defined( Q_WS_MAC )#include "qt_mac.h"#include <qmap.h>#include <qcache.h>class QFontEngineMac : public QFontEngine{#if 0    ATSFontMetrics *info;#else    FontInfo *info;#endif    int psize;    FMFontFamily fmfam;    QMacFontInfo *internal_fi;    mutable ATSUTextLayout mTextLayout;    enum { widthCacheSize = 0x500 };    mutable unsigned char widthCache[widthCacheSize];    friend class QFont;    friend class QGLContext;    friend class QFontPrivate;    friend class QMacSetFontInfo;public:    QFontEngineMac();    ~QFontEngineMac();    Error stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const;    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );    glyph_metrics_t boundingBox( const glyph_t *glyphs,			       const advance_t *advances, const qoffset_t *offsets, int numGlyphs );    glyph_metrics_t boundingBox( glyph_t glyph );    int ascent() const { return (int)info->ascent; }    int descent() const { return (int)info->descent; }    int leading() const { return (int)info->leading; }#if 0    int maxCharWidth() const { return (int)info->maxAdvanceWidth; }#else    int maxCharWidth() const { return info->widMax; }#endif    const char *name() const { return "ATSUI"; }    bool canRender( const QChar *string,  int len );    Type type() const { return QFontEngine::Mac; }    void calculateCost();    enum { WIDTH=0x01, DRAW=0x02, EXISTS=0x04 };    int doTextTask(const QChar *s, int pos, int use_len, int len, uchar task, int =-1, int y=-1,		   QPaintDevice *dev=NULL, const QRegion *rgn=NULL) const;};#elif defined( Q_WS_WIN )class QFontEngineWin : public QFontEngine{public:    QFontEngineWin( const char *name, HDC, HFONT, bool, LOGFONT );    Error stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const;    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );    glyph_metrics_t boundingBox( const glyph_t *glyphs,			       const advance_t *advances, const qoffset_t *offsets, int numGlyphs );    glyph_metrics_t boundingBox( glyph_t glyph );    int ascent() const;    int descent() const;    int leading() const;    int maxCharWidth() const;    int minLeftBearing() const;    int minRightBearing() const;    const char *name() const;    bool canRender( const QChar *string,  int len );    Type type() const;    enum { widthCacheSize = 0x800, cmapCacheSize = 0x500 };    unsigned char widthCache[widthCacheSize];};#if 0class QFontEngineUniscribe : public QFontEngineWin{public:    void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags );    bool canRender( const QChar *string,  int len );    Type type() const;};#endif#endif // Q_WS_WIN#endif

⌨️ 快捷键说明

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