ultimatepp/rainbow/WinGl/FontGl.h
unodgs cde2305fc9 Rainbow: WinGL..
git-svn-id: svn://ultimatepp.org/upp/trunk@3677 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-07-19 18:12:50 +00:00

50 lines
877 B
C

#ifndef _WinGl_FontGl_h_
#define _WinGl_FontGl_h_
struct OpenGLFont : Moveable<OpenGLFont>
{
float scaleW;
float scaleH;
float lineHeight;
float base;
bool texturesUpdated;
float vtx[1024 * 4 * 2];
float crd[1024 * 4 * 2];
struct CharInfo : Moveable<CharInfo>
{
int id;
float x;
float y;
float width;
float height;
float xoffset;
float yoffset;
float xadvance;
int page;
};
Vector<CharInfo> chars;
VectorMap<int, VectorMap<int, float> > kerns;
Vector<String> files;
Array<byte> compiledFiles;
Vector<int64> pages;
OpenGLFont() : texturesUpdated(false)
{}
~OpenGLFont()
{}
void LoadBrc(const byte* xml, const byte* image);
void Load(const String& fileName);
void Parse(const char* xml, bool parsePages);
void UpdateTextures();
void BuildVertices();
};
Size GetTextSize(const wchar *text, const OpenGLFont& fi, int n);
#endif