FlatUI
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Enumerations Groups Pages
flatui::FontFamily Struct Reference

A class holding font family information. The class provides various ways to support fonts such as a font collection (multiple fonts in a file), referencing a font by a famly name etc. More...

#include <font_buffer.h>

Detailed Description

A class holding font family information. The class provides various ways to support fonts such as a font collection (multiple fonts in a file), referencing a font by a famly name etc.

Public Member Functions

 FontFamily (const std::string &name, int32_t index, const std::string &lang, bool family_name)
 
 FontFamily (const char *name, bool family_name)
 
 FontFamily (const char *name)
 
 FontFamily (const std::string &name)
 
const std::string & get_name () const
 
const std::string & get_original_name () const
 
const std::string & get_language () const
 Language. The entry is ignored when opening a font.
 
int32_t get_index () const
 
bool is_family_name () const
 Check if the font name is a family name.
 
bool is_font_collection () const
 

Protected Member Functions

std::string CreateFontCollectionName (const std::string &name)
 

Static Protected Member Functions

static std::string NormalizeFontName (const std::string &name)
 

Protected Attributes

std::string original_name_
 
std::string font_name_
 
std::string lang_
 
int32_t index_
 
bool family_name_
 

Member Function Documentation

int32_t flatui::FontFamily::get_index ( ) const
inline

Index in a font collection. kIndexInvalid indicates the font is not a font collection.

const std::string& flatui::FontFamily::get_name ( ) const
inline

Font name. When the font is in a font collection file, the name is mangled with a font collection index.

const std::string& flatui::FontFamily::get_original_name ( ) const
inline

Original font name. When family_name_ is set, it's treated as a family name.

bool flatui::FontFamily::is_font_collection ( ) const
inline

Check if the font is in a font collection that holds multiple fonts in a single file.


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