ScummVM API documentation
Ultima::Ultima3::Gfx::CharSet Class Reference

#include <charset.h>

Inheritance diagram for Ultima::Ultima3::Gfx::CharSet:
Graphics::Font

Public Member Functions

int getFontHeight () const override
 
int getMaxCharWidth () const override
 
int getCharWidth (uint32) const override
 
void drawChar (Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override
 
- Public Member Functions inherited from Graphics::Font
virtual int getFontHeight () const =0
 
virtual Common::String getFontName () const
 
virtual int getFontAscent () const
 
virtual int getFontDescent () const
 
virtual int getFontLeading () const
 
virtual int getMaxCharWidth () const =0
 
virtual int getCharWidth (uint32 chr) const =0
 
virtual int getKerningOffset (uint32 left, uint32 right) const
 
virtual Common::Rect getBoundingBox (uint32 chr) const
 
Common::Rect getBoundingBox (const Common::String &str, int x=0, int y=0, const int w=0, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
Common::Rect getBoundingBox (const Common::U32String &str, int x=0, int _y=0, const int w=0, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
virtual void drawChar (Surface *dst, uint32 chr, int x, int y, uint32 color) const =0
 
virtual void drawChar (ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) const
 
virtual void drawAlphaChar (Surface *dst, uint32 chr, int x, int y, uint32 color) const
 
virtual void drawAlphaChar (ManagedSurface *dst, uint32 chr, int x, int y, uint32 color) const
 
void drawString (Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawString (Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawString (ManagedSurface *dst, const Common::String &str, int x, int _y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawString (ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawAlphaString (Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawAlphaString (Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawAlphaString (ManagedSurface *dst, const Common::String &str, int x, int _y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
void drawAlphaString (ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false, bool allowCharClipping=false) const
 
int getStringWidth (const Common::String &str) const
 
int getStringWidth (const Common::U32String &str) const
 
int wordWrapText (const Common::String &str, int maxWidth, Common::Array< Common::String > &lines, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
int wordWrapText (const Common::U32String &str, int maxWidth, Common::Array< Common::U32String > &lines, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
int wordWrapText (const Common::U32String &str, int maxWidth, Common::Array< Common::U32String > &lines, Common::Array< bool > &lineContinuation, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
 
void scaleSingleGlyph (Surface *scaleSurface, int *grayScaleMap, int grayScaleMapSize, int width, int height, int xOffset, int yOffset, int grayLevel, int chr, int srcheight, int srcwidth, float scale) const
 

Static Public Member Functions

static void load ()
 
static uint32 moonIcon (byte phase)
 

Detailed Description

The game's font from CHARSET.ULT: 128 glyphs of 8x8 pixels at 2 bits per pixel, or from the upgrade's EGA or VGA files, depending on the renderer. Each glyph carries its own colors, and is kept a byte per pixel. The moon icons of the upgrade follow the text characters.

Member Function Documentation

◆ moonIcon()

static uint32 Ultima::Ultima3::Gfx::CharSet::moonIcon ( byte  phase)
inlinestatic

Returns the character that is drawn as the icon for a phase of a moon

◆ getFontHeight()

int Ultima::Ultima3::Gfx::CharSet::getFontHeight ( ) const
inlineoverridevirtual

Return the height of the font.

Returns
Font height in pixels.

Implements Graphics::Font.

◆ getMaxCharWidth()

int Ultima::Ultima3::Gfx::CharSet::getMaxCharWidth ( ) const
inlineoverridevirtual

Return the maximum width of the font.

Returns
Maximum font width in pixels.

Implements Graphics::Font.

◆ getCharWidth()

int Ultima::Ultima3::Gfx::CharSet::getCharWidth ( uint32  ) const
inlineoverridevirtual

Return the width of a specific character.

Parameters
chrThe character to query the width of.
Returns
The width of the character in pixels.

Implements Graphics::Font.

◆ drawChar()

void Ultima::Ultima3::Gfx::CharSet::drawChar ( Graphics::Surface *  dst,
uint32  chr,
int  x,
int  y,
uint32  color 
) const
overridevirtual

Draw a character at a specific point on the surface.

Parameters
dstThe surface to draw on.
chrThe character to draw.
xThe x coordinate where to draw the character.
yThe y coordinate where to draw the character.
colorThe color of the character.

Implements Graphics::Font.


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