Numworks Epsilon  1.4.1
Graphing Calculator Operating System
text.h
Go to the documentation of this file.
1 #ifndef KANDINSKY_TEXT_H
2 #define KANDINSKY_TEXT_H
3 
4 #include <kandinsky/size.h>
5 #include "../src/large_font.h"
6 #include "../src/small_font.h"
7 
8 class KDText {
9 public:
10  enum class FontSize {
11  Small,
12  Large
13  };
14  constexpr static int k_tabCharacterWidth = 4;
15  static KDSize stringSize(const char * text, FontSize size = FontSize::Large);
16  constexpr static KDSize charSize(FontSize size = FontSize::Large) {
17  return size == FontSize::Large ? KDSize(BITMAP_LargeFont_CHARACTER_WIDTH, BITMAP_LargeFont_CHARACTER_HEIGHT) : KDSize(BITMAP_SmallFont_CHARACTER_WIDTH, BITMAP_SmallFont_CHARACTER_HEIGHT);
18  }
19 };
20 
21 #endif
static KDSize stringSize(const char *text, FontSize size=FontSize::Large)
Definition: text.cpp:6
Definition: text.h:8
Definition: size.h:6
static constexpr KDSize charSize(FontSize size=FontSize::Large)
Definition: text.h:16
FontSize
Definition: text.h:10
static constexpr int k_tabCharacterWidth
Definition: text.h:14