diff options
Diffstat (limited to 'src/libjin/Graphics/Font/TTF.cpp')
-rw-r--r-- | src/libjin/Graphics/Font/TTF.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/libjin/Graphics/Font/TTF.cpp b/src/libjin/Graphics/Font/TTF.cpp index 0e70d70..edef8a8 100644 --- a/src/libjin/Graphics/Font/TTF.cpp +++ b/src/libjin/Graphics/Font/TTF.cpp @@ -229,6 +229,18 @@ namespace graphics delete page; } + Page* TTF::typeset(const Content& text, int lineheight, int spacing) + { + Page* page = new Page(); + page->font = this; + vector<GlyphArrayDrawInfo>& glyphinfolist = page->glyphinfolist; + vector<GlyphVertex>& glyphvertices = page->glyphvertices; + int texture = -1; + TTFGlyph* glyph = nullptr; + GlyphVertex vertex; + Vector2<int> p(0, 0); + int i = 0; + #define glyphvertices_push(_x, _y, _u, _v) \ vertex.x = _x; vertex.y = _y;\ vertex.u = _u; vertex.v = _v;\ @@ -254,17 +266,6 @@ namespace graphics glyphvertices_push(p.x + glyph->width, p.y, bbox.x + bbox.w, bbox.y); \ }while(0) - Page* TTF::typeset(const Content& text, int lineheight, int spacing) - { - Page* page = new Page(); - page->font = this; - vector<GlyphArrayDrawInfo>& glyphinfolist = page->glyphinfolist; - vector<GlyphVertex>& glyphvertices = page->glyphvertices; - int texture = -1; - TTFGlyph* glyph = nullptr; - GlyphVertex vertex; - Vector2<int> p(0, 0); - int i = 0; for (Codepoint c : text) { if (c == 0x0D) |