summaryrefslogtreecommitdiff
path: root/src/gui/fonts/font.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/fonts/font.h')
-rw-r--r--src/gui/fonts/font.h47
1 files changed, 17 insertions, 30 deletions
diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h
index f6a64a2d8..551800bdb 100644
--- a/src/gui/fonts/font.h
+++ b/src/gui/fonts/font.h
@@ -69,6 +69,8 @@
#include "gui/color.h"
+#include "gui/fonts/textchunksmall.h"
+
#include <SDL_ttf.h>
#include <map>
@@ -82,33 +84,18 @@ class Image;
const unsigned int CACHES_NUMBER = 256;
-class SDLTextChunkSmall
-{
- public:
- SDLTextChunkSmall(const std::string &text0, const Color &color0,
- const Color &color1);
-
- SDLTextChunkSmall(const SDLTextChunkSmall &old);
-
- bool operator==(const SDLTextChunkSmall &chunk) const;
- bool operator<(const SDLTextChunkSmall &chunk) const;
-
- std::string text;
- Color color;
- Color color2;
-};
-
-class SDLTextChunk final
+class TextChunk final
{
public:
- SDLTextChunk(const std::string &text0, const Color &color0,
- const Color &color1);
+ TextChunk(const std::string &text0,
+ const Color &color0,
+ const Color &color1);
- A_DELETE_COPY(SDLTextChunk)
+ A_DELETE_COPY(TextChunk)
- ~SDLTextChunk();
+ ~TextChunk();
- bool operator==(const SDLTextChunk &chunk) const;
+ bool operator==(const TextChunk &chunk) const;
void generate(TTF_Font *const font, const float alpha);
@@ -116,8 +103,8 @@ class SDLTextChunk final
std::string text;
Color color;
Color color2;
- SDLTextChunk *prev;
- SDLTextChunk *next;
+ TextChunk *prev;
+ TextChunk *next;
};
@@ -128,9 +115,9 @@ class TextChunkList final
A_DELETE_COPY(TextChunkList)
- void insertFirst(SDLTextChunk *const item);
+ void insertFirst(TextChunk *const item);
- void moveToFirst(SDLTextChunk *const item);
+ void moveToFirst(TextChunk *const item);
void removeBack();
@@ -138,11 +125,11 @@ class TextChunkList final
void clear();
- SDLTextChunk *start;
- SDLTextChunk *end;
+ TextChunk *start;
+ TextChunk *end;
uint32_t size;
- std::map<SDLTextChunkSmall, SDLTextChunk*> search;
- std::map<std::string, SDLTextChunk*> searchWidth;
+ std::map<TextChunkSmall, TextChunk*> search;
+ std::map<std::string, TextChunk*> searchWidth;
};
/**