Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: graphics/EAFont.cpp
- Revision:
- 6:4fe6f365cbeb
- Parent:
- 3:24fbf4dbd7e5
diff -r 236b346643e8 -r 4fe6f365cbeb graphics/EAFont.cpp
--- a/graphics/EAFont.cpp Tue Apr 27 23:13:21 2010 +0000
+++ b/graphics/EAFont.cpp Thu May 06 23:32:14 2010 +0000
@@ -3,7 +3,6 @@
#include "mbed.h"
#include "EAFont.h"
-#include "../widgets/EAImage.h"
#include "../screen/EALCD.h"
EAFont::EAFont()
@@ -11,6 +10,8 @@
_chars(NULL),
_noChars(0)
{
+ _img.setCached(true);
+ _img.setMask(true);
}
EAFont::~EAFont()
@@ -124,12 +125,15 @@
_chars[i].xAdvance = v;
}
- fclose(fp);
+ fclose(fp);
+
+ // Now load the cached image.
+ _img.load(_path);
return true;
}
-bool EAFont::getCharacter(char c, EACharacter& detail)
+bool EAFont::_getCharacter(char c, EACharacter& detail)
{
for (int i = 0; i < _noChars; i++)
{