Plutonium framework API 0.3.0
UI framework libraries for libnx
Loading...
Searching...
No Matches
pu::ttf::Font Class Reference

#include <ttf_Font.hpp>

Public Member Functions

 Font (const u32 font_sz)
 
 ~Font ()
 
i32 LoadFromMemory (void *ptr, const size_t size, FontFaceDisposingFunction disp_fn)
 
i32 LoadFromFile (const std::string &path)
 
void Unload (const i32 font_idx)
 
u32 GetFontSize ()
 
sdl2::Font FindValidFontFor (const Uint16 ch)
 
std::pair< u32, u32 > GetTextDimensions (const std::string &str)
 
sdl2::Texture RenderText (const std::string &str, const ui::Color clr)
 

Static Public Member Functions

static void EmptyFontFaceDisposingFunction (void *)
 
static constexpr bool IsValidFontFaceIndex (const i32 index)
 

Static Public Attributes

static constexpr i32 InvalidFontFaceIndex = -1
 
static constexpr u32 DefaultFontSize = 25
 

Constructor & Destructor Documentation

◆ Font()

pu::ttf::Font::Font ( const u32 font_sz)
inline

◆ ~Font()

pu::ttf::Font::~Font ( )

Member Function Documentation

◆ EmptyFontFaceDisposingFunction()

static void pu::ttf::Font::EmptyFontFaceDisposingFunction ( void * )
inlinestatic

◆ FindValidFontFor()

sdl2::Font pu::ttf::Font::FindValidFontFor ( const Uint16 ch)

◆ GetFontSize()

u32 pu::ttf::Font::GetFontSize ( )
inline

◆ GetTextDimensions()

std::pair< u32, u32 > pu::ttf::Font::GetTextDimensions ( const std::string & str)

◆ IsValidFontFaceIndex()

static constexpr bool pu::ttf::Font::IsValidFontFaceIndex ( const i32 index)
inlinestaticconstexpr

◆ LoadFromFile()

i32 pu::ttf::Font::LoadFromFile ( const std::string & path)

◆ LoadFromMemory()

i32 pu::ttf::Font::LoadFromMemory ( void * ptr,
const size_t size,
FontFaceDisposingFunction disp_fn )

◆ RenderText()

sdl2::Texture pu::ttf::Font::RenderText ( const std::string & str,
const ui::Color clr )

◆ Unload()

void pu::ttf::Font::Unload ( const i32 font_idx)

Member Data Documentation

◆ DefaultFontSize

u32 pu::ttf::Font::DefaultFontSize = 25
staticconstexpr

◆ InvalidFontFaceIndex

i32 pu::ttf::Font::InvalidFontFaceIndex = -1
staticconstexpr

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