aboutsummaryrefslogtreecommitdiff
path: root/graphics/font.h
diff options
context:
space:
mode:
authorMax Horn2004-08-15 14:05:28 +0000
committerMax Horn2004-08-15 14:05:28 +0000
commitbfe9c26a3d838d17c28eceac00c0e35cd5c6138e (patch)
treeed9247d6b9b3d3ebdb50b76eea352a146ad30811 /graphics/font.h
parent0f142572f7e4ee643a462d22654a4f9dd9b2ee7a (diff)
downloadscummvm-rg350-bfe9c26a3d838d17c28eceac00c0e35cd5c6138e.tar.gz
scummvm-rg350-bfe9c26a3d838d17c28eceac00c0e35cd5c6138e.tar.bz2
scummvm-rg350-bfe9c26a3d838d17c28eceac00c0e35cd5c6138e.zip
Changed the way NewFonts are instantiated (will make it easier to add multiple fonts)
svn-id: r14625
Diffstat (limited to 'graphics/font.h')
-rw-r--r--graphics/font.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/graphics/font.h b/graphics/font.h
index 2d5d6c9bd4..416c3719d9 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -76,8 +76,7 @@ typedef unsigned short bitmap_t; /* bitmap image unit size*/
/* builtin C-based proportional/fixed font structure */
/* based on The Microwindows Project http://microwindows.org */
-class NewFont : public Font {
-protected:
+struct FontDesc {
const char * name; /* font name*/
int maxwidth; /* max width in pixels*/
int height; /* height in pixels*/
@@ -89,12 +88,17 @@ protected:
const unsigned char* width; /* character widths or NULL if fixed*/
int defaultchar; /* default char (not glyph index)*/
long bits_size; /* # words of bitmap_t bits*/
+};
+
+class NewFont : public Font {
+protected:
+ FontDesc desc;
public:
- NewFont();
+ NewFont(const FontDesc &d) : desc(d) {}
- virtual int getFontHeight() const { return height; }
- virtual int getMaxCharWidth() const { return maxwidth; };
+ virtual int getFontHeight() const { return desc.height; }
+ virtual int getMaxCharWidth() const { return desc.maxwidth; };
virtual int getCharWidth(byte chr) const;
virtual void drawChar(const Surface *dst, byte chr, int x, int y, uint32 color) const;