Nebula
Loading...
Searching...
No Matches
tbuifontrenderer.h
Go to the documentation of this file.
1// ================================================================================
2// == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
3// == See tb_core.h for more information. ==
4// ================================================================================
5
6#include <math.h>
7#include "tb_font_renderer.h"
8#include "tb_renderer.h"
9#include "platform/tb_system_interface.h"
10#include "tb_tempbuffer.h"
11
12namespace TBUI
13{
15
16class TBUISTBFontRenderer : public tb::TBFontRenderer
17{
18public:
21
22 bool Load(const char* filename, int size);
23
24 virtual tb::TBFontFace* Create(tb::TBFontManager* font_manager, const char* filename, const tb::TBFontDescription& font_desc);
25
26 virtual tb::TBFontMetrics GetMetrics();
27 virtual bool RenderGlyph(tb::TBFontGlyphData* dst_bitmap, UCS4 cp);
28 virtual void GetGlyphMetrics(tb::TBGlyphMetrics* metrics, UCS4 cp);
29 virtual int GetAdvance(UCS4 cp1, UCS4 cp2);
30
31private:
32 stbtt_fontinfo font;
33 tb::TBTempBuffer ttf_buffer;
34 unsigned char* render_data;
35 float scale;
36};
37}
virtual bool RenderGlyph(tb::TBFontGlyphData *dst_bitmap, UCS4 cp)
Definition tbuifontrenderer.cc:40
TBUISTBFontRenderer()
Definition tbuifontrenderer.cc:17
tb::TBTempBuffer ttf_buffer
Definition tbuifontrenderer.h:33
~TBUISTBFontRenderer()
Definition tbuifontrenderer.cc:22
float scale
Definition tbuifontrenderer.h:35
virtual void GetGlyphMetrics(tb::TBGlyphMetrics *metrics, UCS4 cp)
Definition tbuifontrenderer.cc:51
virtual int GetAdvance(UCS4 cp1, UCS4 cp2)
Definition tbuifontrenderer.cc:65
virtual tb::TBFontMetrics GetMetrics()
Definition tbuifontrenderer.cc:28
virtual tb::TBFontFace * Create(tb::TBFontManager *font_manager, const char *filename, const tb::TBFontDescription &font_desc)
Definition tbuifontrenderer.cc:89
unsigned char * render_data
Definition tbuifontrenderer.h:34
bool Load(const char *filename, int size)
Definition tbuifontrenderer.cc:76
stbtt_fontinfo font
Definition tbuifontrenderer.h:32
Turbobadger UI Batch.
Definition tbuibatch.h:18