STLL  0.0
Simple Text Layouting Library
STLL::FontResource_c Class Reference

This class represents a font resource. More...

Public Member Functions

template<typename... Args>
 FontResource_c (Args...par)
 
void addFont (const std::string &pathname)
 
void addFont (std::pair< std::shared_ptr< uint8_t >, size_t > data, const std::string &descr)
 
size_t size (void) const
 
auto begin (void) const
 
auto end (void) const
 
 FontResource_c (void)
 
internal::FontFileResource_c getRessource (size_t idx) const
 
bool operator< (const FontResource_c &b) const
 

Detailed Description

This class represents a font resource.

A font is a collection of several font files that together constitute of the font. If several files contain the same glyphs then the first one added to this resource class will be used

A good example for the usage of this is the google noto font. Which consists of many files but the hebrew fonts don't contain numbers for example, so you have to take the glyphs for numbers from the regular fonts with the roman letters

Constructor & Destructor Documentation

template<typename... Args>
STLL::FontResource_c::FontResource_c ( Args...  par)
inline

create a new font resource with one font

STLL::FontResource_c::FontResource_c ( void  )
inline

Create an empty resource

This constructor is required by the STL containers, don't use it

Member Function Documentation

void STLL::FontResource_c::addFont ( const std::string &  pathname)
inline

add another font to the resource: a file given its path.

Parameters
pathnameFile name of the file to use as font
void STLL::FontResource_c::addFont ( std::pair< std::shared_ptr< uint8_t >, size_t >  data,
const std::string &  descr 
)
inline

add another font to the resource: from memory.

Parameters
datais a pair containing a shared pointer to the data and the size of the data
descrdescription string, will be used to describe the font when an exception is thrown (e.g. problems loading the font)
auto STLL::FontResource_c::begin ( void  ) const
inline

iterators for for loops

auto STLL::FontResource_c::end ( void  ) const
inline
internal::FontFileResource_c STLL::FontResource_c::getRessource ( size_t  idx) const
inline

get the fontfile ressource class for the fontfile at a given index

bool STLL::FontResource_c::operator< ( const FontResource_c b) const
inline

operator for stl container usage

size_t STLL::FontResource_c::size ( void  ) const
inline

the number of font files in this font


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