diff options
author | frogbotherer <therealchriswest@hotmail.com> | 2012-07-28 00:56:31 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-28 02:50:27 +0200 |
commit | c348bcf42667cd230c47a51cb32016090ee02e39 (patch) | |
tree | 502a20b5aeb63f7901aa7db1cab8509aa45e1887 /crawl-ref/source/fontwrapper-ft.h | |
parent | fcc898b07d67c4f6240d5fe030cff3230c7ffcb5 (diff) | |
download | crawl-ref-c348bcf42667cd230c47a51cb32016090ee02e39.tar.gz crawl-ref-c348bcf42667cd230c47a51cb32016090ee02e39.zip |
Don't crash on font rendering when there's anything outside ascender..descender.
This worked for DejaVu Sans, but failed on a number of other fonts.
(cherry picked from commit e0ba98f9c56185d8bc650df4df9d49b4bb428e4b)
[commit message rewritten -- 1KB]
Diffstat (limited to 'crawl-ref/source/fontwrapper-ft.h')
-rw-r--r-- | crawl-ref/source/fontwrapper-ft.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/fontwrapper-ft.h b/crawl-ref/source/fontwrapper-ft.h index 2352c02a37..c5e37ee007 100644 --- a/crawl-ref/source/fontwrapper-ft.h +++ b/crawl-ref/source/fontwrapper-ft.h @@ -91,7 +91,10 @@ protected: int8_t advance; // per-glyph width int8_t width; - // does glyph have any pixels? + // per-glyph ascender + int8_t ascender; + + // does glyph have any pixels? bool renderable; // index of prev/next glyphs in LRU @@ -117,13 +120,15 @@ protected: // minimum offset (likely negative) int m_min_offset; - // size of ascender - int ascender; + // size of ascender according to font + int m_ascender; // other font metrics coord_def charsz; unsigned int m_ft_width; unsigned int m_ft_height; + int m_max_width; + int m_max_height; GenericTexture m_tex; GLShapeBuffer *m_buf; |