igor::iTextureFont Class Reference

#include <iTextureFont.h>

Public Member Functions

 ~iTextureFont ()
 
float32 measureWidth (const iaString &text, float32 size)
 
float32 measureHeight (const iaString &text, float32 size, float32 maxWidth, float32 lineHeight=1.15f)
 
bool isValid () const
 
iTexturePtr getTexture () const
 
const std::vector< iCharacterDimensions > & getCharacters () const
 

Static Public Member Functions

static iTextureFontPtr create (iTexturePtr texture, iFontType type=iFontType::FixedDigitWidth, iColorMask colorMask=iColorMask::Alpha, float32 colorMaskThreshold=0.5f)
 

Detailed Description

texture font

Constructor & Destructor Documentation

◆ ~iTextureFont()

igor::iTextureFont::~iTextureFont ( )

cleans up

Member Function Documentation

◆ create()

iTextureFontPtr igor::iTextureFont::create ( iTexturePtr  texture,
iFontType  type = iFontType::FixedDigitWidth,
iColorMask  colorMask = iColorMask::Alpha,
float32  colorMaskThreshold = 0.5f 
)
static
Returns
a newly created font
Parameters
texturethe texture to use (needs to be loaded already)
typefont type
colorMaskuse this color channel to detect the size of characters
colorMaskThresholdthis threshold determines what texel belongs to the character and wich not

◆ getCharacters()

const std::vector< iCharacterDimensions > & igor::iTextureFont::getCharacters ( ) const

returns character set

Returns
vector of characters

◆ getTexture()

iTexturePtr igor::iTextureFont::getTexture ( ) const

returns pointer to the font texture

Returns
pointer to font texture

◆ isValid()

bool igor::iTextureFont::isValid ( ) const

returns true if the font was loading correctly

◆ measureHeight()

float32 igor::iTextureFont::measureHeight ( const iaString text,
float32  size,
float32  maxWidth,
float32  lineHeight = 1.15f 
)

calculates the height of a iaString with line breaks

Parameters
textthe text to calculate with
sizefont size
maxWidthwith to make line break
lineHeightfactor for the line height (default value is 1.15)

◆ measureWidth()

float32 igor::iTextureFont::measureWidth ( const iaString text,
float32  size 
)

calculates the width of the given iaString using this font

Parameters
textthe text to calculate the width
sizesize of the font

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