ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Public Member Functions | Private Attributes | List of all members
ImageFont Class Reference

a font created from an Image More...

#include <imagefont.h>

Public Member Functions

 ImageFont ()
 Standardconstructor. More...
 
 ImageFont (const String &fname, const String &glyphs)
 
 ~ImageFont () ROLAND_DEFAULT void init()
 Standarddestructor. More...
 
void clear ()
 Frees all used resources. More...
 
void load (const String &fname, const String &glyphs, uchar alpha=255)
 
const Rectglyph (Uint8 chr) const
 
const Imageimage ()
 
void setSpacing (Uint16 spacing)
 
Uint16 spacing () const
 

Private Attributes

Image mImage
 
String mGlyphs
 
Rect mGlyphRect [256]
 
Uint16 mSpacing
 

Detailed Description

a font created from an Image

Author
Fred Klaus devel.nosp@m.opme.nosp@m.nt@fk.nosp@m.web..nosp@m.de

Constructor & Destructor Documentation

ImageFont ( )
inline
ImageFont ( const String fname,
const String glyphs 
)

Constructor, calls ImageFont::load to load an Image

Parameters
fname= the filename of an Image
glyphs= the available glyphs in the Image

References Image::height(), init(), ImageFont::load(), ImageFont::mGlyphRect, ImageFont::mImage, Image::pixel(), Rect::setHeight(), Rect::setPos(), Rect::setWidth(), Image::width(), and x.

~ImageFont ( )

Standarddestructor.

Check whether the Image is valid and sets up the glyphs and their Rect class

Referenced by ImageFont::ImageFont().

Member Function Documentation

void clear ( )

Frees all used resources.

References Image::clear(), and ImageFont::mImage.

Referenced by ImageFont::ImageFont(), and ImageFont::load().

const Rect & glyph ( Uint8  chr) const
inline
const Image& image ( )
inline
void load ( const String fname,
const String glyphs,
uchar  alpha = 255 
)

loads an Image and calls ImageFont::init to set up the glyphs

Parameters
fname= the filename of an Image
glyphs= the available glyphs in the Image

References ImageFont::clear(), Image::convert(), init(), Image::load(), ImageFont::mGlyphs, and ImageFont::mImage.

Referenced by ImageFont::ImageFont(), and Canvas::setFont().

void setSpacing ( Uint16  spacing)

Referenced by ImageFont::image().

Uint16 spacing ( ) const
inline

Member Data Documentation

Rect mGlyphRect[256]
private
String mGlyphs
private
Image mImage
private
Uint16 mSpacing
private

Referenced by ImageFont::spacing().


The documentation for this class was generated from the following files: