aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/Font.cpp
blob: 7b5dd68e2bcf0c001e41e2495b8b924cbefb34ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "../../include/mglpp/graphics/Font.hpp"
#include <string.h>
namespace mgl {
    Font::Font() {
        memset(&font, 0, sizeof(font));
    }

    Font::~Font() {
        mgl_font_unload(&font);
    }

    bool Font::load_from_file(const char *filepath, unsigned int character_size) {
        if(font.texture.id)
            return false;
        return mgl_font_load_from_file(&font, filepath, character_size) == 0;
    }

    unsigned int Font::get_character_size() const {
        return font.character_size;
    }

    mgl_font* Font::internal_font() {
        return &font;
    }
}