Subversion Repositories tpanel

Rev

Rev 156 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 157
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020, 2021 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020 to 2022 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 47... Line 47...
47
    FONT_ITALIC,
47
    FONT_ITALIC,
48
    FONT_BOLD,
48
    FONT_BOLD,
49
    FONT_BOLD_ITALIC
49
    FONT_BOLD_ITALIC
50
}FONT_STYLE;
50
}FONT_STYLE;
51
 
51
 
-
 
52
typedef enum FONT_TYPE
-
 
53
{
-
 
54
    FT_UNKNOWN,     // Unknown font type
-
 
55
    FT_NORMAL,      // Normal font with mostly letters
-
 
56
    FT_SYMBOL,      // Normal font with mostly symbols
-
 
57
    FT_SYM_MS       // Proprietary Microsoft symbol font
-
 
58
}FONT_TYPE;
-
 
59
 
52
class TFont : public TValidateFile
60
class TFont : public TValidateFile
53
{
61
{
54
    public:
62
    public:
55
        TFont();
63
        TFont();
56
        ~TFont();
64
        ~TFont();
Line 64... Line 72...
64
        SkFontStyle getSkiaStyle(int number);
72
        SkFontStyle getSkiaStyle(int number);
65
        sk_sp<SkTypeface> getTypeFace(int number);
73
        sk_sp<SkTypeface> getTypeFace(int number);
66
 
74
 
67
        static std::vector<std::string> getFontPathList();
75
        static std::vector<std::string> getFontPathList();
68
        static SkGlyphID *textToGlyphs(const std::string& str, sk_sp<SkTypeface>& typeFace, size_t *size);
76
        static SkGlyphID *textToGlyphs(const std::string& str, sk_sp<SkTypeface>& typeFace, size_t *size);
69
        static bool isSymbol(sk_sp<SkTypeface>& typeFace);
77
        static FONT_TYPE isSymbol(sk_sp<SkTypeface>& typeFace);
70
        static size_t utf8ToUtf16(const std::string& str, uint16_t **uni, bool toSymbol = false);
78
        static size_t utf8ToUtf16(const std::string& str, uint16_t **uni, bool toSymbol = false);
71
        static double pixelToPoint(int dpi, int pixel);
79
        static double pixelToPoint(int dpi, int pixel);
72
 
80
 
73
    private:
81
    private:
74
        static void parseCmap(const unsigned char *cmaps);
82
        static void parseCmap(const unsigned char *cmaps);