Subversion Repositories tpanel

Rev

Rev 446 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 446 Rev 462
Line 27... Line 27...
27
#include <include/core/SkTypeface.h>
27
#include <include/core/SkTypeface.h>
28
#include <include/core/SkFontStyle.h>
28
#include <include/core/SkFontStyle.h>
29
 
29
 
30
typedef struct FONT_T
30
typedef struct FONT_T
31
{
31
{
32
    int number;
32
    int number{0};
33
    std::string file;
33
    std::string file;
34
    int fileSize;
34
    int fileSize{0};
35
    int faceIndex;
35
    int faceIndex{0};
36
    std::string name;
36
    std::string name;
37
    std::string subfamilyName;
37
    std::string subfamilyName;
38
    std::string fullName;
38
    std::string fullName;
39
    int size;
39
    int size{0};
40
    int usageCount;
40
    int usageCount{0};
41
}FONT_T;
41
}FONT_T;
42
 
42
 
43
typedef enum FONT_STYLE
43
typedef enum FONT_STYLE
44
{
44
{
45
    FONT_NONE,
45
    FONT_NONE,
Line 58... Line 58...
58
}FONT_TYPE;
58
}FONT_TYPE;
59
 
59
 
60
class TFont : public TValidateFile
60
class TFont : public TValidateFile
61
{
61
{
62
    public:
62
    public:
63
        TFont();
63
        TFont(const std::string& fname, bool tp=false);
64
        ~TFont();
64
        ~TFont();
65
 
65
 
66
        void initialize();
66
        void initialize();
67
        bool systemFonts(bool setup=false);
67
        bool systemFonts(bool setup=false);
68
        FONT_T getFont(int number);
68
        FONT_T getFont(int number);
Line 70... Line 70...
70
        int getFontIDfromName(const std::string& name);
70
        int getFontIDfromName(const std::string& name);
71
        FONT_STYLE getStyle(int number);
71
        FONT_STYLE getStyle(int number);
72
        FONT_STYLE getStyle(FONT_T& font);
72
        FONT_STYLE getStyle(FONT_T& font);
73
        SkFontStyle getSkiaStyle(int number);
73
        SkFontStyle getSkiaStyle(int number);
74
        sk_sp<SkTypeface> getTypeFace(int number);
74
        sk_sp<SkTypeface> getTypeFace(int number);
-
 
75
        sk_sp<SkTypeface> getTypeFace(const std::string& ff);
-
 
76
        void setTP5(bool tp) { mIsTP5 = tp; }
75
 
77
 
76
        static std::vector<std::string> getFontPathList();
78
        static std::vector<std::string> getFontPathList();
77
        static SkGlyphID *textToGlyphs(const std::string& str, sk_sp<SkTypeface>& typeFace, size_t *size);
79
        static SkGlyphID *textToGlyphs(const std::string& str, sk_sp<SkTypeface>& typeFace, size_t *size);
78
        static FONT_TYPE isSymbol(sk_sp<SkTypeface>& typeFace);
80
        static FONT_TYPE isSymbol(sk_sp<SkTypeface>& typeFace);
79
        static size_t utf8ToUtf16(const std::string& str, uint16_t **uni, bool toSymbol = false);
81
        static size_t utf8ToUtf16(const std::string& str, uint16_t **uni, bool toSymbol = false);
Line 83... Line 85...
83
        static void parseCmap(const unsigned char *cmaps);
85
        static void parseCmap(const unsigned char *cmaps);
84
        static uint16_t getGlyphIndex(SkUnichar);
86
        static uint16_t getGlyphIndex(SkUnichar);
85
        static void _freeCmap();
87
        static void _freeCmap();
86
 
88
 
87
        std::map<int, FONT_T> mFonts;
89
        std::map<int, FONT_T> mFonts;
-
 
90
        bool mIsTP5{false};
-
 
91
        std::string mFontFile;
88
};
92
};
89
 
93
 
90
#endif
94
#endif