From 252e074c41a73312be3e235b07be266a9aee59fb Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 15 Oct 2018 12:58:40 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Font/TTF.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/libjin/Graphics/Font/TTF.cpp') 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& glyphinfolist = page->glyphinfolist; + vector& glyphvertices = page->glyphvertices; + int texture = -1; + TTFGlyph* glyph = nullptr; + GlyphVertex vertex; + Vector2 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& glyphinfolist = page->glyphinfolist; - vector& glyphvertices = page->glyphvertices; - int texture = -1; - TTFGlyph* glyph = nullptr; - GlyphVertex vertex; - Vector2 p(0, 0); - int i = 0; for (Codepoint c : text) { if (c == 0x0D) -- cgit v1.1-26-g67d0