summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilefont.h
diff options
context:
space:
mode:
authorfrogbotherer <therealchriswest@hotmail.com>2012-06-09 00:25:56 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-06-25 01:20:29 +0200
commitd988224c93603d5cbae8aab07399a8bd4e8898dc (patch)
treec2dca3089e203d650e0f09a0217db442d13c2c45 /crawl-ref/source/tilefont.h
parent7e19b61f0df90202fe19380e09ac19bad473d629 (diff)
downloadcrawl-ref-d988224c93603d5cbae8aab07399a8bd4e8898dc.tar.gz
crawl-ref-d988224c93603d5cbae8aab07399a8bd4e8898dc.zip
added proper unicode support at the cost of some memory overhead
The maximum number of glyphs is fixed at 256, (which is enough for languages with latin-like characters), but is easily increased via some constants in fontwrapper-ft.cc, with a memory trade-off. Features of this code: - any character in the font can be rendered - if crawl tries to render more than the max number of glyphs, it will crash - if crawl tries to render a glyph not in the font, an upside-down question mark will be printed instead - for each fontwrapper instance (font face, size and attributes), this keeps an array of pixels and an equivalent texture in memory for 256 possible glyphs. This is why increasing the number of available glyphs pushes memory use up
Diffstat (limited to 'crawl-ref/source/tilefont.h')
-rw-r--r--crawl-ref/source/tilefont.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/tilefont.h b/crawl-ref/source/tilefont.h
index 101a80a4ab..420ff094b0 100644
--- a/crawl-ref/source/tilefont.h
+++ b/crawl-ref/source/tilefont.h
@@ -53,8 +53,8 @@ public:
virtual unsigned int char_width() const = 0;
virtual unsigned int char_height() const = 0;
- virtual unsigned int string_width(const char *text) const = 0;
- virtual unsigned int string_width(const formatted_string &str) const = 0;
+ virtual unsigned int string_width(const char *text) = 0;
+ virtual unsigned int string_width(const formatted_string &str) = 0;
virtual unsigned int string_height(const char *text) const = 0;
virtual unsigned int string_height(const formatted_string &str) const = 0;