ScummVM API documentation
Kyra::Font Class Referenceabstract

#include <screen.h>

Inheritance diagram for Kyra::Font:
Kyra::AMIGAFont Kyra::ChineseFont Kyra::DOSFont Kyra::JohabFontLoK Kyra::MultiSubsetFont Kyra::SJISFont Kyra::ChineseOneByteFontHOF Kyra::ChineseOneByteFontLoK Kyra::ChineseOneByteFontMR Kyra::ChineseTwoByteFontHOF Kyra::ChineseTwoByteFontLoK Kyra::ChineseTwoByteFontMR

Public Types

enum  Type {
  kASCII = 0, kJIS_X0201, kSJIS, kBIG5,
  kJohab
}
 
enum  FontStyle {
  kStyleNone = 0, kStyleLeftShadow = 1 << 0, kStyleBorder = 1 << 1, kStyleFat = 1 << 2,
  kStyleNarrow1 = 1 << 3, kStyleNarrow2 = 1 << 4, kStyleFullWidth = 1 << 5, kStyleForceOneByte = 1 << 6
}
 

Public Member Functions

virtual bool load (Common::SeekableReadStream &file)=0
 
virtual bool usesOverlay () const
 
virtual Type getType () const =0
 
virtual int getHeight () const =0
 
virtual int getWidth () const =0
 
virtual int getCharWidth (uint16 c) const =0
 
virtual int getCharHeight (uint16 c) const
 
virtual void setColorMap (const uint8 *src)=0
 
virtual void set16bitColorMap (const uint16 *src)
 
virtual void setStyles (int styles)
 
virtual void drawChar (uint16 c, byte *dst, int pitch, int bpp) const =0
 
virtual void drawChar (uint16 c, byte *dst, int pitch, int xOffs, int yOffs) const
 

Detailed Description

A class that handles KYRA fonts.

Member Function Documentation

◆ load()

virtual bool Kyra::Font::load ( Common::SeekableReadStream file)
pure virtual

Tries to load a file from the given stream

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.

◆ usesOverlay()

virtual bool Kyra::Font::usesOverlay ( ) const
inlinevirtual

Whether the font draws on the overlay.

Reimplemented in Kyra::SJISFont.

◆ getType()

virtual Type Kyra::Font::getType ( ) const
pure virtual

Whether the font is Ascii or Sjis.

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.

◆ getHeight()

virtual int Kyra::Font::getHeight ( ) const
pure virtual

◆ getWidth()

virtual int Kyra::Font::getWidth ( ) const
pure virtual

The font width, this is the maximal character width.

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.

◆ getCharWidth()

virtual int Kyra::Font::getCharWidth ( uint16  c) const
pure virtual

Gets the width of a specific character.

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.

◆ getCharHeight()

virtual int Kyra::Font::getCharHeight ( uint16  c) const
inlinevirtual

Gets the height of a specific character. The only font that needs this is the SegaCD one. For all other fonts this is a fixed value.

Reimplemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, and Kyra::ChineseFont.

◆ setColorMap()

virtual void Kyra::Font::setColorMap ( const uint8 *  src)
pure virtual

Sets a text palette map. The map contains 16 entries.

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.

◆ set16bitColorMap()

virtual void Kyra::Font::set16bitColorMap ( const uint16 *  src)
inlinevirtual

Sets a text 16bit palette map. Only used in in EOB II FM-Towns. The map contains 2 entries.

◆ setStyles()

virtual void Kyra::Font::setStyles ( int  styles)
inlinevirtual

Sets a drawing style. Only rudimentary implementation based on what is needed.

Reimplemented in Kyra::MultiSubsetFont, Kyra::ChineseFont, and Kyra::SJISFont.

◆ drawChar()

virtual void Kyra::Font::drawChar ( uint16  c,
byte *  dst,
int  pitch,
int  bpp 
) const
pure virtual

Draws a specific character.

TODO/FIXME: Replace this with a nicer API. Currently the user has to assure that the character fits. We use this API, since it's hard to assure dirty rect handling from outside Screen.

Implemented in Kyra::MultiSubsetFont, Kyra::JohabFontLoK, Kyra::ChineseFont, Kyra::SJISFont, Kyra::AMIGAFont, and Kyra::DOSFont.


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