SuperTuxKart
Public Member Functions | Private Member Functions | List of all members
BoldFace Class Reference

A font which uses regular TTFs to render title or important message in STK with a bold outline, it shares the same FaceTTF with RegularFace. More...

#include <bold_face.hpp>

Inheritance diagram for BoldFace:
Inheritance graph
[legend]

Public Member Functions

 BoldFace ()
 Constructor of BoldFace. More...
 
virtual void init () OVERRIDE
 Initialize the font structure, but don't load glyph here.
 
virtual void reset () OVERRIDE
 Clear all the loaded characters, sub-class can do pre-loading of characters after this.
 
- Public Member Functions inherited from FontWithFace
 FontWithFace (const std::string &name)
 Constructor. More...
 
virtual ~FontWithFace ()
 Destructor. More...
 
virtual core::dimension2d< u32 > getDimension (const core::stringw &text, FontSettings *font_settings=NULL)
 Get the dimension of text with support to different FontSettings, it will also do checking for missing characters in font and lazy load them. More...
 
int getCharacterFromPos (const wchar_t *text, int pixel_x, FontSettings *font_settings=NULL) const
 Calculate the index of the character in the text on a specific position. More...
 
void render (const std::vector< gui::GlyphLayout > &gl, const core::rect< s32 > &position, const video::SColor &color, bool hcenter, bool vcenter, const core::rect< s32 > *clip, FontSettings *font_settings, FontCharCollector *char_collector=NULL)
 Render text and clip it to the specified rectangle if wanted, it will also do checking for missing characters in font and lazy load them. More...
 
virtual void drawText (const core::stringw &text, const core::rect< s32 > &position, const video::SColor &color, bool hcenter, bool vcenter, const core::rect< s32 > *clip, FontSettings *font_settings, FontCharCollector *char_collector=NULL)
 
void drawTextQuick (const core::stringw &text, const core::rect< s32 > &position, const video::SColor &color, bool hcenter, bool vcenter, const core::rect< s32 > *clip, FontSettings *font_settings, FontCharCollector *char_collector=NULL)
 
void dumpGlyphPage (const std::string &name)
 Write the current glyph page in png inside current running directory. More...
 
void dumpGlyphPage ()
 Write the current glyph page in png inside current running directory. More...
 
gui::IGUISpriteBank * getSpriteBank () const
 Return the sprite bank. More...
 
const FontAreagetAreaFromCharacter (const wchar_t c, bool *fallback_font) const
 Return the FontArea about a character. More...
 
unsigned int getDPI () const
 Return the dpi of this face. More...
 
FaceTTFgetFaceTTF () const
 
void insertGlyph (unsigned font_number, unsigned glyph_index)
 Render a glyph for a character into bitmap and save it into the glyph page. More...
 
int getFontMaxHeight () const
 
virtual bool disableTextShaping () const
 
float getInverseShaping () const
 
virtual bool useColorGlyphPage () const
 
void setDPI ()
 Set the face dpi which is resolution-dependent. More...
 

Private Member Functions

virtual unsigned int getGlyphPageSize () const OVERRIDE
 Defined by sub-class about the texture size of glyph page, it should be a power of two. More...
 
virtual float getScalingFactorOne () const OVERRIDE
 Defined by sub-class about the scaling factor 1. More...
 
virtual unsigned int getScalingFactorTwo () const OVERRIDE
 Defined by sub-class about the scaling factor 2. More...
 
virtual bool isBold () const OVERRIDE
 Override it if sub-class has bold outline. More...
 
virtual int shapeOutline (FT_Outline *outline) const OVERRIDE
 Embolden the glyph to make bold font using FT_Outline_Embolden. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FontWithFace
void insertCharacters (const wchar_t *in_ptr, bool first_load=false)
 Check characters to see if they are loaded in font, if not load them. More...
 
void updateCharactersList ()
 Update the supported characters for this font if required.
 
void setFallbackFont (FontWithFace *face)
 Set the fallback font for this font, so if some character is missing in this font, it will use that fallback font to try rendering it. More...
 
void setFallbackFontScale (float scale)
 Set the scaling of fallback font. More...
 
- Protected Attributes inherited from FontWithFace
int m_font_max_height
 Used in vertical dimension calculation. More...
 
int m_glyph_max_height
 Used in top side bearing calculation. More...
 

Detailed Description

A font which uses regular TTFs to render title or important message in STK with a bold outline, it shares the same FaceTTF with RegularFace.

Constructor & Destructor Documentation

◆ BoldFace()

BoldFace::BoldFace ( )

Constructor of BoldFace.

Parameters
ttfFaceTTF for BoldFace to use.

Member Function Documentation

◆ getGlyphPageSize()

virtual unsigned int BoldFace::getGlyphPageSize ( ) const
inlineprivatevirtual

Defined by sub-class about the texture size of glyph page, it should be a power of two.

Implements FontWithFace.

◆ getScalingFactorOne()

virtual float BoldFace::getScalingFactorOne ( ) const
inlineprivatevirtual

Defined by sub-class about the scaling factor 1.

Implements FontWithFace.

◆ getScalingFactorTwo()

virtual unsigned int BoldFace::getScalingFactorTwo ( ) const
inlineprivatevirtual

Defined by sub-class about the scaling factor 2.

Implements FontWithFace.

◆ isBold()

virtual bool BoldFace::isBold ( ) const
inlineprivatevirtual

Override it if sub-class has bold outline.

Reimplemented from FontWithFace.

◆ shapeOutline()

int BoldFace::shapeOutline ( FT_Outline *  outline) const
privatevirtual

Embolden the glyph to make bold font using FT_Outline_Embolden.

Returns
A FT_Error value.

Reimplemented from FontWithFace.


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