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

Public Member Functions

 ShapeFont (const uint8 *data, uint32 size, const ConvertShapeFormat *format, const uint16 flexId, const uint32 shapenum)
 
int getHeight () override
 get the height of the font More...
 
int getBaseline () override
 get the baseline of the font (relative from the top) More...
 
int getBaselineSkip () override
 get the baselineskip of the font (distance between two baselines) More...
 
int getWidth (char c)
 
int getVlead () const
 
int getHlead () const
 
void setVLead (int vl)
 
void setHLead (int hl)
 
int charToFrameNum (char c) const
 
void getStringSize (const Common::String &text, int32 &width, int32 &height) override
 
RenderedText * renderText (const Common::String &text, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false, Common::String::size_type cursor=Common::String::npos) override
 
- Public Member Functions inherited from Ultima::Ultima8::Font
virtual int getHeight ()=0
 get the height of the font More...
 
virtual int getBaseline ()=0
 get the baseline of the font (relative from the top) More...
 
virtual int getBaselineSkip ()=0
 get the baselineskip of the font (distance between two baselines) More...
 
virtual void getStringSize (const Common::String &text, int32 &width, int32 &height)=0
 
virtual RenderedText * renderText (const Common::String &text, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false, Common::String::size_type cursor=Common::String::npos)=0
 
virtual void getTextSize (const Common::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
 
- Public Member Functions inherited from Ultima::Ultima8::Shape
 Shape (const uint8 *data, uint32 size, const ConvertShapeFormat *format, const uint16 flexId, const uint32 shapenum)
 
 Shape (Common::SeekableReadStream *src, const ConvertShapeFormat *format)
 
void setPalette (const Palette *pal)
 
const Palette * getPalette () const
 
uint32 frameCount () const
 
void getTotalDimensions (int32 &w, int32 &h, int32 &x, int32 &y) const
 
const ShapeFrame * getFrame (unsigned int frame) const
 
void getShapeId (uint16 &flexId, uint32 &shapenum) const
 

Additional Inherited Members

- Public Types inherited from Ultima::Ultima8::Font
enum  TextAlign { TEXT_LEFT , TEXT_CENTER , TEXT_RIGHT }
 
- Static Public Member Functions inherited from Ultima::Ultima8::Shape
static const ConvertShapeFormat * DetectShapeFormat (const uint8 *data, uint32 size)
 
static const ConvertShapeFormat * DetectShapeFormat (Common::SeekableReadStream &ds, uint32 size)
 
- Protected Attributes inherited from Ultima::Ultima8::Font
bool _highRes
 

Member Function Documentation

◆ getHeight()

int Ultima::Ultima8::ShapeFont::getHeight ( )
overridevirtual

get the height of the font

Implements Ultima::Ultima8::Font.

◆ getBaseline()

int Ultima::Ultima8::ShapeFont::getBaseline ( )
overridevirtual

get the baseline of the font (relative from the top)

Implements Ultima::Ultima8::Font.

◆ getBaselineSkip()

int Ultima::Ultima8::ShapeFont::getBaselineSkip ( )
overridevirtual

get the baselineskip of the font (distance between two baselines)

Implements Ultima::Ultima8::Font.

◆ getStringSize()

void Ultima::Ultima8::ShapeFont::getStringSize ( const Common::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.

◆ renderText()

RenderedText * Ultima::Ultima8::ShapeFont::renderText ( const Common::String &  text,
unsigned int &  remaining,
int32  width = 0,
int32  height = 0,
TextAlign  align = TEXT_LEFT,
bool  u8specials = false,
bool  pagebreaks = false,
Common::String::size_type  cursor = Common::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: