Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CFont::GlyphMap Class Reference

Relatively efficient lookup of GlyphData from 16-bit Unicode codepoint. More...

#include <Font.h>

Public Member Functions

 GlyphMap ()=default
 
 ~GlyphMap ()=default
 
 MOVABLE (GlyphMap)
 
 NONCOPYABLE (GlyphMap)
 
void set (std::uint16_t codepoint, const GlyphData &glyph)
 Store the GlyphData for a given Unicode codepoint. More...
 
const GlyphData * get (std::uint16_t codepoint) const
 

Private Attributes

std::unique_ptr< std::array< GlyphData, 256 > > m_Data [256]
 

Detailed Description

Relatively efficient lookup of GlyphData from 16-bit Unicode codepoint.

This is stored as a sparse 2D array, exploiting the knowledge that a font typically only supports a small number of 256-codepoint blocks, so most elements of m_Data will be NULL. This implementation expand the store the GlyphData for a given Unicode codepoint (0 ≤ cp ≤ 0x10FFFF)

Constructor & Destructor Documentation

◆ GlyphMap()

CFont::GlyphMap::GlyphMap ( )
default

◆ ~GlyphMap()

CFont::GlyphMap::~GlyphMap ( )
default

Member Function Documentation

◆ get()

const CFont::GlyphData * CFont::GlyphMap::get ( std::uint16_t  codepoint) const

◆ MOVABLE()

CFont::GlyphMap::MOVABLE ( GlyphMap  )

◆ NONCOPYABLE()

CFont::GlyphMap::NONCOPYABLE ( GlyphMap  )

◆ set()

void CFont::GlyphMap::set ( std::uint16_t  codepoint,
const GlyphData &  glyph 
)

Store the GlyphData for a given Unicode codepoint.

Parameters
codepointThe unicode codepoint (0 ≤ cp ≤ 0x10FFFF)
glyphThe glyphData data to store

Member Data Documentation

◆ m_Data

std::unique_ptr<std::array<GlyphData, 256> > CFont::GlyphMap::m_Data[256]
private

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