ScummVM API documentation
Ultima::Ultima8::Font Class Referenceabstract
Inheritance diagram for Ultima::Ultima8::Font:
Ultima::Ultima8::JPFont Ultima::Ultima8::ShapeFont Ultima::Ultima8::TTFont

Classes

struct  SJISTraits
 
struct  Traits
 

Public Types

enum  TextAlign { TEXT_LEFT, TEXT_CENTER, TEXT_RIGHT }
 

Public Member Functions

virtual int getHeight ()=0
 get the height of the font
 
virtual int getBaseline ()=0
 get the baseline of the font (relative from the top)
 
virtual int getBaselineSkip ()=0
 get the baselineskip of the font (distance between two baselines)
 
virtual void getStringSize (const Std::string &text, int32 &width, int32 &height)=0
 
virtual RenderedTextrenderText (const Std::string &text, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false, Std::string::size_type cursor=Std::string::npos)=0
 
virtual void getTextSize (const Std::string &text, int32 &resultwidth, int32 &resultheight, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false)
 
void setHighRes (bool hr)
 
bool isHighRes () const
 

Protected Attributes

bool _highRes
 

Member Function Documentation

◆ getStringSize()

virtual void Ultima::Ultima8::Font::getStringSize ( const Std::string text,
int32 &  width,
int32 &  height 
)
pure virtual

get the dimensions of a string (not containing any newlines)

Parameters
textThe string
widthReturns the width
heightReturns the height

Implemented in Ultima::Ultima8::ShapeFont, Ultima::Ultima8::TTFont, and Ultima::Ultima8::JPFont.

◆ renderText()

virtual RenderedText* Ultima::Ultima8::Font::renderText ( const Std::string text,
unsigned int &  remaining,
int32  width = 0,
int32  height = 0,
TextAlign  align = TEXT_LEFT,
bool  u8specials = false,
bool  pagebreaks = false,
Std::string::size_type  cursor = Std::string::npos 
)
pure virtual

render a string

Parameters
textThe text
remainingReturns index of the first character not printed
widthThe width of the target rectangle, or 0 for unlimited
heightThe height of the target rectangle, or 0 for unlimited
alignAlignment of the text (left, right, center)
u8specialsIf true, interpret the special characters U8 uses
pagebreaksIf true (and u8specials too), stop at U8 pagebreaks
Returns
the rendered text in a RenderedText object

Implemented in Ultima::Ultima8::ShapeFont, Ultima::Ultima8::TTFont, and Ultima::Ultima8::JPFont.

◆ getTextSize()

virtual void Ultima::Ultima8::Font::getTextSize ( const Std::string text,
int32 &  resultwidth,
int32 &  resultheight,
unsigned int &  remaining,
int32  width = 0,
int32  height = 0,
TextAlign  align = TEXT_LEFT,
bool  u8specials = false,
bool  pagebreaks = false 
)
virtual

get the dimensions of a rendered string

Parameters
textThe text
resultwidthReturns the resulting width
resultheightReturns the resulting height
remainingReturns index of the first character not printed
widthThe width of the target rectangle, or 0 for unlimited
heightThe height of the target rectangle, or 0 for unlimited
alignAlignment of the text (left, right, center)
u8specialsIf true, interpret the special characters U8 uses
pagebreaksIf true (and u8specials too), stop at U8 pagebreaks

Reimplemented in Ultima::Ultima8::TTFont, and Ultima::Ultima8::JPFont.


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