STLL
0.0
Simple Text Layouting Library
|
a class contains all resources for a family of fonts More...
Public Member Functions | |
FontFamily_c (std::shared_ptr< FontCache_c > c) | |
Initialize an empty family, using the given font cache to get the fonts. More... | |
FontFamily_c (void) | |
Initialize an empty family, using font cache created specifically for this family. More... | |
Font_c | getFont (uint32_t size, const std::string &style="normal", const std::string &variant="normal", const std::string &weight="normal", const std::string &stretch="normal") |
Get a font instance from the family. More... | |
void | addFont (const FontResource_c &res, const std::string &style="normal", const std::string &variant="normal", const std::string &weight="normal", const std::string &stretch="normal") |
Add a font to the family. More... | |
a class contains all resources for a family of fonts
A family is a set of fonts with roman, italics, bold, ... variants this class will store the resources to each font and create a FontFace_c for it, when requested.
Usually you don't need to use this class directly as the CSS stylesheet class TextStyleSheet_c will take care of this.
|
inline |
Initialize an empty family, using the given font cache to get the fonts.
|
inline |
Initialize an empty family, using font cache created specifically for this family.
This is normally not what you want as you will probably have more than one family and they all should use the same cache
void STLL::FontFamily_c::addFont | ( | const FontResource_c & | res, |
const std::string & | style = "normal" , |
||
const std::string & | variant = "normal" , |
||
const std::string & | weight = "normal" , |
||
const std::string & | stretch = "normal" |
||
) |
Add a font to the family.
res | Resource to use for this member of the font family |
style | Font style, values are usually: "normal", "italic", "oblique" |
variant | Font variant, values are usually: "normal", "small-caps" |
weight | Font weight, typical values are: "lighter", "normal", "bold", "bolder" |
stretch | Font stretch, typical values are: "normal", "condensed" |
Font_c STLL::FontFamily_c::getFont | ( | uint32_t | size, |
const std::string & | style = "normal" , |
||
const std::string & | variant = "normal" , |
||
const std::string & | weight = "normal" , |
||
const std::string & | stretch = "normal" |
||
) |
Get a font instance from the family.
size | Size in pixels |
style | Font style, values are usually: "normal", "italic", "oblique" |
variant | Font variant, values are usually: "normal", "small-caps" |
weight | Font weight, typical values are: "lighter", "normal", "bold", "bolder" |
stretch | Font stretch, typical values are: "normal", "condensed" |