summaryrefslogtreecommitdiff
path: root/src/gfx_layout.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gfx_layout.h')
-rw-r--r--src/gfx_layout.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gfx_layout.h b/src/gfx_layout.h
index 6dbf3f872..ea9c34aae 100644
--- a/src/gfx_layout.h
+++ b/src/gfx_layout.h
@@ -167,12 +167,16 @@ class Layouter : public AutoDeleteSmallVector<ParagraphLayout::Line *, 4> {
ParagraphLayout *GetParagraphLayout(CharType *buff, CharType *buff_end, FontMap &fontMapping);
CharType buffer[DRAW_STRING_BUFFER]; ///< Buffer for the text that is going to be drawn.
- SmallVector<Font *, 4> fonts; ///< The fonts needed for drawing.
+
+ typedef SmallMap<TextColour, Font *> FontColourMap;
+ static FontColourMap fonts[FS_END];
+ static Font *GetFont(FontSize size, TextColour colour);
public:
Layouter(const char *str, int maxw = INT32_MAX, TextColour colour = TC_FROMSTRING, FontSize fontsize = FS_NORMAL);
- ~Layouter();
Dimension GetBounds();
+
+ static void ResetFontCache(FontSize size);
};
#endif /* GFX_LAYOUT_H */