Files
Upsilon/kandinsky/src/text.cpp
Émilie Feral f51ae5db12 [kandinsky] Introduce two fonts: small font and large font
Change-Id: I502dfa88d627b09ac5af76155140af63547025cd
2017-01-27 11:14:01 +01:00

15 lines
450 B
C++

#include <kandinsky/text.h>
#include <string.h>
#include "small_font.h"
#include "large_font.h"
KDSize KDText::stringSize(const char * text, FontSize size) {
if (text == nullptr) {
return KDSizeZero;
}
if (size == FontSize::Large) {
return KDSize(BITMAP_LargeFont_CHARACTER_WIDTH*strlen(text), BITMAP_LargeFont_CHARACTER_HEIGHT);
}
return KDSize(BITMAP_SmallFont_CHARACTER_WIDTH*strlen(text), BITMAP_SmallFont_CHARACTER_HEIGHT);
}