Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CFontMetrics Class Reference

Helper class for measuring sizes of text. More...

#include <FontMetrics.h>

Public Member Functions

 CFontMetrics (CStrIntern font)
 
int GetLineSpacing () const
 
int GetHeight () const
 
int GetCharacterWidth (wchar_t c) const
 
void CalculateStringSize (const wchar_t *string, int &w, int &h) const
 

Private Attributes

std::shared_ptr< CFontm_Font
 

Detailed Description

Helper class for measuring sizes of text.

This will load the font when necessary, and will return plausible values if loading fails (since misrendering is better than crashing).

Constructor & Destructor Documentation

◆ CFontMetrics()

CFontMetrics::CFontMetrics ( CStrIntern  font)

Member Function Documentation

◆ CalculateStringSize()

void CFontMetrics::CalculateStringSize ( const wchar_t *  string,
int &  w,
int &  h 
) const

◆ GetCharacterWidth()

int CFontMetrics::GetCharacterWidth ( wchar_t  c) const

◆ GetHeight()

int CFontMetrics::GetHeight ( ) const

◆ GetLineSpacing()

int CFontMetrics::GetLineSpacing ( ) const

Member Data Documentation

◆ m_Font

std::shared_ptr<CFont> CFontMetrics::m_Font
private

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