mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 01:59:59 +01:00
15 lines
450 B
C++
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);
|
|
}
|