aboutsummaryrefslogtreecommitdiff
path: root/src/lua/graphics/Font.h
blob: 33436903fb03c16d62d025cb91bd41267953f9ad (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __JIN_LUA_GRAPHICS_FONT_H
#define __JIN_LUA_GRAPHICS_FONT_H
#include "libjin/jin.h"
#include "../luaopen_types.h"

namespace jin
{
namespace lua
{
namespace graphics
{

    class Font : public Object
    {
    public:
        Font()
        {
            font = new jin::graphics::Font();
        }
        
        void box(const char* str, int fheight, int spacing, int lheight, int* w, int * h)
        {
            font->box(str, fheight, spacing, lheight, w, h);
        }
        void loadb(const unsigned char* data)
        {
            font->loadb(data);
        }
        void render(
            const char* text, // rendered text 
            float x, float y, // render position 
            int fheight,      // font height
            int spacing,      // font spacing 
            int lheight)      // line height
        {
            font->render(text, x, y, fheight, spacing, lheight);
        }
    private:
        ~Font()
        {
            delete font;
        }

        jin::graphics::Font* font;

    };

} // graphics
} // lua
} // jin

#endif // __JIN_LUA_GRAPHICS_FONT_H