ScummVM API documentation
Ultima::Ultima8::TTFont Class Reference
Inheritance diagram for Ultima::Ultima8::TTFont:
Ultima::Ultima8::Font

Public Member Functions

 TTFont (Graphics::Font *font, uint32 rgb, int bordersize, bool antiAliased, bool SJIS)
 
int getHeight () override
 get the height of the font
 
int getBaseline () override
 get the baseline of the font (relative from the top)
 
int getBaselineSkip () override
 get the baselineskip of the font (distance between two baselines)
 
bool isAntialiased ()
 
void getStringSize (const Std::string &text, int32 &width, int32 &height) override
 
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) override
 
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) override
 
- Public Member Functions inherited from Ultima::Ultima8::Font
void setHighRes (bool hr)
 
bool isHighRes () const
 

Protected Member Functions

void addTextBorder (Graphics::ManagedSurface &textSurf, uint32 *texBuf, const Ultima::Ultima8::Rect &dims, int32 resultWidth, int32 resultHeight, uint32 borderColor)
 

Protected Attributes

Graphics::Font_ttfFont
 
uint32 _color
 
int _borderSize
 
bool _antiAliased
 
bool _SJIS
 
Graphics::PixelFormat _PF_RGBA
 
uint16 _bullet
 
- Protected Attributes inherited from Ultima::Ultima8::Font
bool _highRes
 

Additional Inherited Members

- Public Types inherited from Ultima::Ultima8::Font
enum  TextAlign { TEXT_LEFT, TEXT_CENTER, TEXT_RIGHT }
 

Member Function Documentation

◆ getStringSize()

void Ultima::Ultima8::TTFont::getStringSize ( const Std::string text,
int32 &  width,
int32 &  height 
)
overridevirtual

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

Parameters
textThe string
widthReturns the width
heightReturns the height

Implements Ultima::Ultima8::Font.

◆ getTextSize()

void Ultima::Ultima8::TTFont::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 
)
overridevirtual

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 from Ultima::Ultima8::Font.

◆ renderText()

RenderedText* Ultima::Ultima8::TTFont::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 
)
overridevirtual

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

Implements Ultima::Ultima8::Font.


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