[Kandinsky] Create a KDText class for text measurement

Change-Id: Ie3ecd402b5476f41a2f8694a276f62495fbcdbd1
This commit is contained in:
Romain Goyet
2016-08-19 10:28:43 +02:00
parent d2ff3457b5
commit f93da3b0d8
8 changed files with 22 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
#include <kandinsky/context.h>
#include <string.h>
#include "font.h"
void KDContext::drawChar(char character, KDPoint p, uint8_t inverse) {
@@ -24,7 +23,3 @@ void KDContext::drawString(const char * text, KDPoint p, uint8_t inverse) {
position = position.translatedBy(characterSize);
}
}
KDSize KDContext::stringSize(const char * text) {
return KDSize(BITMAP_FONT_CHARACTER_WIDTH*strlen(text), BITMAP_FONT_CHARACTER_HEIGHT);
}