From ddfedbff7d9ea4f344173ef2c228a51a778d7433 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 15 Oct 2018 07:18:13 +0800 Subject: =?UTF-8?q?+=E4=BB=8ETTFData=E5=88=9B=E5=BB=BATTF=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Font/TTF.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/libjin/Graphics/Font/TTF.h') diff --git a/src/libjin/Graphics/Font/TTF.h b/src/libjin/Graphics/Font/TTF.h index 4f51138..7f4f873 100644 --- a/src/libjin/Graphics/Font/TTF.h +++ b/src/libjin/Graphics/Font/TTF.h @@ -19,11 +19,13 @@ namespace jin { namespace graphics { + + class TTF; /** * TTFData - * |- TTF - * |- TTF + * |- TTF(14px) + * |- TTF(15px) * . * . * . @@ -35,7 +37,9 @@ namespace graphics ~TTFData(); - void pushTTFsize(unsigned int ttfsize); + TTF* createTTF(unsigned ttfsize); + + void pushTTFsize(unsigned ttfsize); void popTTFsize(); Channel* getCodepointBitmapAlpha(unsigned int codepoint, int* width, int* height, int* xoff, int* yoff) const; @@ -62,7 +66,7 @@ namespace graphics class TTF : public Font { public: - static TTF* createTTF(TTFData* ttfData, unsigned int ttfSzie); + static TTF* createTTF(TTFData* ttfData, unsigned ttfSzie); Page* typeset(const Text& text, int lineheight, int spacing = 0) override; Page* typeset(const Content& text, int lineheight, int spacing = 0) override; @@ -74,6 +78,8 @@ namespace graphics ~TTF(); private: + friend class TTFData; + struct TTFGlyph { GLuint atlas; -- cgit v1.1-26-g67d0