ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A font that is able to draw SJIS encoded characters. More...

#include <sjis.h>

Inheritance diagram for Graphics::FontSJIS:

List of all members.

Public Types

enum  DrawingMode { kDefaultMode, kOutlineMode, kShadowMode, kFMTownsShadowMode }
 

Enable drawing with outline or shadow if supported by the Font.

More...

Public Member Functions

virtual ~FontSJIS ()
virtual bool loadData ()=0
 Load the font data.
virtual void setDrawingMode (DrawingMode mode)
virtual void toggleFlippedMode (bool enable)
 Enable flipped character drawing if supported by the Font (e.g.
virtual void setCharSpacing (int spacing)
 Set spacing between characters and lines.
virtual void setLineSpacing (int spacing)
virtual uint getFontHeight () const =0
 Returns the height of the font.
virtual uint getMaxFontWidth () const =0
 Returns the max.
virtual uint getCharWidth (uint16 ch) const =0
 Returns the width of a specific character.
void drawChar (Graphics::Surface &dst, uint16 ch, int x, int y, uint32 c1, uint32 c2) const
 Draws a SJIS encoded character on the given surface.
virtual void drawChar (void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2, int maxW, int maxH) const =0
 Draws a SJIS char on the given raw buffer.

Static Public Member Functions

static FontSJIScreateFont (const Common::Platform platform=Common::kPlatformUnknown)
 Creates the first SJIS font, which ROM/font file is present.

Detailed Description

A font that is able to draw SJIS encoded characters.

Definition at line 56 of file sjis.h.


Member Enumeration Documentation

Enable drawing with outline or shadow if supported by the Font.

After changing outline state, getFontHeight and getMaxFontWidth / getCharWidth might return different values!

Enumerator:
kDefaultMode 
kOutlineMode 
kShadowMode 
kFMTownsShadowMode 

Definition at line 84 of file sjis.h.


Constructor & Destructor Documentation

virtual Graphics::FontSJIS::~FontSJIS (  )  [inline, virtual]

Definition at line 58 of file sjis.h.


Member Function Documentation

static FontSJIS* Graphics::FontSJIS::createFont ( const Common::Platform  platform = Common::kPlatformUnknown  )  [static]

Creates the first SJIS font, which ROM/font file is present.

It will also call loadData, so the user can just start using the font.

It'll prefer the platform specific ROM file, when platform is set to a value, which's font ROM is supported. So far that is only kPlatformFMTowns.

The last file tried is ScummVM's SJIS.FNT file.

void Graphics::FontSJIS::drawChar ( Graphics::Surface dst,
uint16  ch,
int  x,
int  y,
uint32  c1,
uint32  c2 
) const

Draws a SJIS encoded character on the given surface.

virtual void Graphics::FontSJIS::drawChar ( void *  dst,
uint16  ch,
int  pitch,
int  bpp,
uint32  c1,
uint32  c2,
int  maxW,
int  maxH 
) const [pure virtual]

Draws a SJIS char on the given raw buffer.

Parameters:
dst pointer to the destination
ch character to draw (in little endian)
pitch pitch of the destination buffer (size in *bytes*)
bpp bytes per pixel of the destination buffer
c1 forground color
c2 outline color
maxW max draw width (to ensure that character drawing takes place within surface boundaries), -1 = no check
maxH max draw height (to ensure that character drawing takes place within surface boundaries), -1 = no check

Implemented in Graphics::FontSJISBase.

virtual uint Graphics::FontSJIS::getCharWidth ( uint16  ch  )  const [pure virtual]

Returns the width of a specific character.

Implemented in Graphics::FontSJISBase.

virtual uint Graphics::FontSJIS::getFontHeight (  )  const [pure virtual]

Returns the height of the font.

Implemented in Graphics::FontSJISBase.

virtual uint Graphics::FontSJIS::getMaxFontWidth (  )  const [pure virtual]

Returns the max.

width of the font.

Implemented in Graphics::FontSJISBase.

virtual bool Graphics::FontSJIS::loadData (  )  [pure virtual]

Load the font data.

Implemented in Graphics::FontTowns, Graphics::FontPCEngine, and Graphics::FontSjisSVM.

virtual void Graphics::FontSJIS::setCharSpacing ( int  spacing  )  [inline, virtual]

Set spacing between characters and lines.

This affects font height / char width

Definition at line 101 of file sjis.h.

virtual void Graphics::FontSJIS::setDrawingMode ( DrawingMode  mode  )  [inline, virtual]

Reimplemented in Graphics::FontSJISBase.

Definition at line 91 of file sjis.h.

virtual void Graphics::FontSJIS::setLineSpacing ( int  spacing  )  [inline, virtual]

Definition at line 102 of file sjis.h.

virtual void Graphics::FontSJIS::toggleFlippedMode ( bool  enable  )  [inline, virtual]

Enable flipped character drawing if supported by the Font (e.g.

in the MI1 circus scene after Guybrush gets shot out of the cannon).

Reimplemented in Graphics::FontSJISBase.

Definition at line 96 of file sjis.h.


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


Generated on Sat Jan 12 2019 05:04:20 for ResidualVM by doxygen 1.7.1
curved edge   curved edge