From 96cf7028b98cd12e2278b37aee43b3d669214abb Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 14 Apr 2006 02:16:55 +0000 Subject: - implements .bdf font loader based on convbdf (sure could have some clean up) - adds three different font styles to the themes (normal, bold (default one), italic) - implements code for specifing the font files in the theme config ('fontfile_normal','fontfile_bold' and 'fontfile_italic' in the 'extra' section) - changes EditTextWidget to use the normal font (has some minor aligment problems with the caret now, though) - extends the FontManager (new functions: getFontByName, assignFontToName, removeFontName) - adds the font style constans to the builtin constants for the evaluator) svn-id: r21868 --- graphics/font.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'graphics/font.h') diff --git a/graphics/font.h b/graphics/font.h index b3ed02c3b4..f9d0cb6033 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -25,6 +25,10 @@ #include "common/str.h" #include "graphics/surface.h" +namespace Common { +class SeekableReadStream; +} + namespace Graphics { // Text alignment modes for drawString() @@ -103,12 +107,16 @@ struct FontDesc { long bits_size; /* # words of bitmap_t bits*/ }; +struct NewFontData; + class NewFont : public Font { protected: FontDesc desc; + NewFontData *font; public: - NewFont(const FontDesc &d) : desc(d) {} + NewFont(const FontDesc &d, NewFontData *font_ = 0) : desc(d), font(font_) {} + ~NewFont(); virtual int getFontHeight() const { return desc.height; } virtual int getMaxCharWidth() const { return desc.maxwidth; }; @@ -117,6 +125,9 @@ public: virtual void drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const; }; +NewFont *loadFont(Common::SeekableReadStream &stream); +NewFont *loadFont(const byte *src, uint32 size); + #if (defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__)) # define DEFINE_FONT(n) \ const NewFont *n; \ -- cgit v1.2.3