diff options
author | Zoolooc <lucianm@users.sourceforge.net> | 2011-03-07 00:51:27 +0100 |
---|---|---|
committer | Zoolooc <lucianm@users.sourceforge.net> | 2011-03-07 00:51:27 +0100 |
commit | 686e1855f3d31bdf94b3af537c5b8061eec438e7 (patch) | |
tree | fe9256ac1489f4b6a8bd350f759c72dd9f136995 /glcdgraphics/font.h | |
parent | bc1a54cc721e10dfb73fec89e367354b46a0eeb1 (diff) | |
download | graphlcd-base-686e1855f3d31bdf94b3af537c5b8061eec438e7.tar.gz graphlcd-base-686e1855f3d31bdf94b3af537c5b8061eec438e7.tar.bz2 |
UTF8 support fixes
Diffstat (limited to 'glcdgraphics/font.h')
-rw-r--r-- | glcdgraphics/font.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/glcdgraphics/font.h b/glcdgraphics/font.h index b36d5ac..6bf72f5 100644 --- a/glcdgraphics/font.h +++ b/glcdgraphics/font.h @@ -23,8 +23,18 @@ namespace GLCD { +class cBitmapCache; + class cFont { +public: + enum eLoadedFntType + { + // native glcd font loaded + lftFNT, + // freetype2 font loaded + lftFT2 + }; private: int totalWidth; int totalHeight; @@ -33,6 +43,11 @@ private: int lineHeight; cBitmap * characters[256]; + eLoadedFntType loadedFontType; + + cBitmapCache *characters_cache; + void *ft2_library; //FT_Library + void *ft2_face; //FT_Face protected: void Init(); void Unload(); @@ -56,14 +71,14 @@ public: void SetSpaceBetween(int width) { spaceBetween = width; }; void SetLineHeight(int height) { lineHeight = height; }; - int Width(char ch) const; + int Width(int ch) const; int Width(const std::string & str) const; int Width(const std::string & str, unsigned int len) const; - int Height(char ch) const; + int Height(int ch) const; int Height(const std::string & str) const; int Height(const std::string & str, unsigned int len) const; - const cBitmap * GetCharacter(char ch) const; + const cBitmap * GetCharacter(int ch) const; void SetCharacter(char ch, cBitmap * bitmapChar); void WrapText(int Width, int Height, std::string & Text, |