graphics

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b33667baf1857c2b982b78c1a72f2b47fd209a2a
parent 66e98ecdebd263318efeeea101361a5aff4c8aba
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun, 15 Sep 2013 20:32:11 -0700

texturefont: accessors for new data, fix measure()

Diffstat:
Mcommon/texturefont.cc | 4+---
Mcommon/texturefont.h | 2++
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/texturefont.cc b/common/texturefont.cc @@ -181,9 +181,7 @@ void TextureFont::measure(const char *s, unsigned *width, unsigned *height) { unsigned cw = info[n].w; if (ch > h) h = ch; - w += cw; - if (*s) - w += info[n].advance; + w += info[n].advance; } *width = w; *height = h; diff --git a/common/texturefont.h b/common/texturefont.h @@ -65,6 +65,8 @@ public: void puts(int x, int y, const char *s); void setColor(unsigned rgba); void measure(const char *s, unsigned *width, unsigned *height); + int getMaxHeight(void) { return header->height_max; } + int getMaxAscent(void) { return header->ascent_max; } private: FontInfo *header; CharInfo *info;