summaryrefslogtreecommitdiff
path: root/glcdgraphics
diff options
context:
space:
mode:
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