aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-15 12:58:40 +0800
committerchai <chaifix@163.com>2018-10-15 12:58:40 +0800
commit252e074c41a73312be3e235b07be266a9aee59fb (patch)
tree51e659073235df737a592fa2fd04baf415cdf122 /src/libjin/Graphics
parent3154c69a341028e88007b9883f438f75e0a5ff55 (diff)
*格式化代码
Diffstat (limited to 'src/libjin/Graphics')
-rw-r--r--src/libjin/Graphics/Font/TTF.cpp23
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)