Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 andreas 1
/*
21 andreas 2
 * Copyright (C) 2020, 2021 by Andreas Theofilu <andreas@theosys.at>
7 andreas 3
 *
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
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
 
19
#ifndef __TFONT_H__
20
#define __TFONT_H__
21
 
22
#include <string>
23
#include <map>
24
#include "tvalidatefile.h"
25
 
26
#include <include/core/SkTypeface.h>
27
 
28
typedef struct FONT_T
29
{
30
    int number;
31
    std::string file;
32
    int fileSize;
33
    int faceIndex;
34
    std::string name;
35
    std::string subfamilyName;
36
    std::string fullName;
37
    int size;
38
    int usageCount;
39
}FONT_T;
40
 
41
typedef enum FONT_STYLE
42
{
43
    FONT_NONE,
44
    FONT_NORMAL,
45
    FONT_ITALIC,
46
    FONT_BOLD,
47
    FONT_BOLD_ITALIC
48
}FONT_STYLE;
49
 
50
class TFont : public TValidateFile
51
{
52
    public:
53
        TFont();
54
        ~TFont();
55
 
56
        void initialize();
57
        FONT_T getFont(int number);
58
        FONT_STYLE getStyle(int number);
59
        FONT_STYLE getStyle(FONT_T& font);
60
        sk_sp<SkTypeface> getTypeFace(int number);
61
 
62
    private:
63
        std::map<int, FONT_T> mFonts;
64
};
65
 
66
#endif