Added interface for using a light font variation (still not functional)

This commit is contained in:
Charles Dang 2016-10-17 23:28:21 +11:00
parent ed6758d933
commit fb6c85e70b
3 changed files with 7 additions and 2 deletions

View file

@ -36,6 +36,9 @@ public:
if(style & ttext::STYLE_BOLD) {
pango_font_description_set_weight(font_, PANGO_WEIGHT_BOLD);
}
if(style & ttext::STYLE_LIGHT) {
pango_font_description_set_weight(font_, PANGO_WEIGHT_LIGHT);
}
if(style & ttext::STYLE_UNDERLINE) {
/* Do nothing here, underline is a property of the layout. */
}

View file

@ -143,7 +143,8 @@ public:
STYLE_NORMAL = 0,
STYLE_BOLD = 1,
STYLE_ITALIC = 2,
STYLE_UNDERLINE = 4
STYLE_UNDERLINE = 4,
STYLE_LIGHT = 8,
};
/***** ***** ***** ***** Query details ***** ***** ***** *****/

View file

@ -56,7 +56,8 @@ font::ttext::FONT_STYLE decode_font_style(const std::string& style)
{"normal", font::ttext::STYLE_NORMAL},
{"bold", font::ttext::STYLE_BOLD},
{"italic", font::ttext::STYLE_ITALIC},
{"underline", font::ttext::STYLE_UNDERLINE}
{"underline", font::ttext::STYLE_UNDERLINE},
{"light", font::ttext::STYLE_LIGHT},
};
if(style.empty()) {