summaryrefslogtreecommitdiff
path: root/glcdgraphics
diff options
context:
space:
mode:
authorAndreas Regel <andreas.regel@gmx.de>2016-10-20 20:49:18 +0200
committerAndreas Regel <andreas.regel@gmx.de>2016-10-20 20:49:18 +0200
commit7958e1b058b98ecf8d8a3fbeebbee71572a2ac21 (patch)
tree0f336c3f9784c4afa1c954ed2081eb164c463b43 /glcdgraphics
parentd4622366d9886fcb62a74507af362dbe73573bcc (diff)
parentaacb78d4335e498417835d518c64b33acb58c749 (diff)
downloadgraphlcd-base-7958e1b058b98ecf8d8a3fbeebbee71572a2ac21.tar.gz
graphlcd-base-7958e1b058b98ecf8d8a3fbeebbee71572a2ac21.tar.bz2
Merge branch 'master' into touchcol
# Conflicts: # HISTORY # Makefile # glcddrivers/Makefile # glcddrivers/drivers.c # glcddrivers/drivers.h # glcddrivers/futabaMDM166A.c # glcddrivers/futabaMDM166A.h # glcddrivers/image.c # glcddrivers/noritake800.c # glcddrivers/noritake800.h # glcdgraphics/Makefile # glcdgraphics/bitmap.c # glcdgraphics/bitmap.h # glcdgraphics/font.c # glcdgraphics/font.h # glcdskin/config.h # glcdskin/display.c # glcdskin/display.h # glcdskin/object.c # glcdskin/object.h # glcdskin/parser.c # graphlcd.conf # tools/convpic/Makefile # tools/crtfont/Makefile # tools/genfont/Makefile # tools/lcdtestpattern/Makefile # tools/showpic/Makefile # tools/showpic/showpic.c # tools/showtext/Makefile
Diffstat (limited to 'glcdgraphics')
-rw-r--r--glcdgraphics/Makefile2
-rw-r--r--glcdgraphics/font.c10
-rw-r--r--glcdgraphics/font.h10
3 files changed, 15 insertions, 7 deletions
diff --git a/glcdgraphics/Makefile b/glcdgraphics/Makefile
index 5abbb2b..2d6e7ff 100644
--- a/glcdgraphics/Makefile
+++ b/glcdgraphics/Makefile
@@ -32,7 +32,7 @@ HEADERS = bitmap.h font.h glcd.h image.h imagefile.h pbm.h extformats.h
### Implicit rules:
%.o: %.c
- $(CXX) $(CXXEXTRA) $(CXXFLAGS) $(LDFLAGS) -c $(DEFINES) $(INCLUDES) $<
+ $(CXX) $(CXXEXTRA) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
# Dependencies:
diff --git a/glcdgraphics/font.c b/glcdgraphics/font.c
index 7e82cee..db14638 100644
--- a/glcdgraphics/font.c
+++ b/glcdgraphics/font.c
@@ -131,7 +131,7 @@ bool cFont::LoadFNT(const std::string & fileName, const std::string & encoding)
{
// cleanup if we already had a loaded font
Unload();
- fontType = 1; //original fonts
+ fontType = ftFNT; //original fonts
isutf8 = (encoding == "UTF-8");
FILE * fontFile;
@@ -275,7 +275,7 @@ bool cFont::LoadFT2(const std::string & fileName, const std::string & encoding,
{
// cleanup if we already had a loaded font
Unload();
- fontType = 2; // ft2 fonts
+ fontType = ftFT2; // ft2 fonts
isutf8 = (encoding == "UTF-8");
#ifdef HAVE_FREETYPE2
@@ -436,7 +436,7 @@ int cFont::Height(const std::string & str, unsigned int len) const
const cBitmap * cFont::GetCharacter(uint32_t ch) const
{
#ifdef HAVE_FREETYPE2
- if ( fontType == 2 ) {
+ if ( fontType == ftFT2 ) {
//lookup in cache
cBitmap *ptr=characters_cache->GetBitmap(ch);
if (ptr)
@@ -506,7 +506,7 @@ const cBitmap * cFont::GetCharacter(uint32_t ch) const
void cFont::SetCharacter(char ch, cBitmap * bitmapChar)
{
#ifdef HAVE_FREETYPE2
- if ( fontType == 2 ) {
+ if ( fontType == ftFT2 ) {
syslog(LOG_ERR, "cFont::SetCharacter: is not supported with FreeType2 fonts!!!");
return;
}
@@ -539,7 +539,7 @@ void cFont::Init()
ft2_face = NULL;
characters_cache = NULL;
#endif
- fontType = 1;
+ fontType = ftFNT;
}
void cFont::Unload()
diff --git a/glcdgraphics/font.h b/glcdgraphics/font.h
index 1315123..a77de14 100644
--- a/glcdgraphics/font.h
+++ b/glcdgraphics/font.h
@@ -29,6 +29,14 @@ class cBitmapCache;
class cFont
{
+public:
+ enum eFontType
+ {
+ // native glcd font loaded
+ ftFNT,
+ // freetype2 font loaded
+ ftFT2
+ };
private:
int totalWidth;
int totalHeight;
@@ -37,7 +45,7 @@ private:
int lineHeight;
cBitmap * characters[256];
- int fontType; //original or FT2 font, 1-original, 2-ft2
+ eFontType fontType;
bool isutf8;
wchar_t iconv_lut[256]; // lookup table needed if encoding != UTF-8