From: Mikko Rasa Date: Sat, 8 Dec 2012 00:03:50 +0000 (+0200) Subject: Font size loading fixes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=51fd0d0fe7ad8a617de8f71985e0c4cb60fec3a9;p=libs%2Fgltk.git Font size loading fixes When a font is specified, reset font size as well. Add a font_size statement for overriding the size. --- diff --git a/source/style.cpp b/source/style.cpp index 001b369..44ad414 100644 --- a/source/style.cpp +++ b/source/style.cpp @@ -38,14 +38,21 @@ Style::Loader::Loader(Style &s, Resources &r): style.font_size = style.font->get_native_size(); } - add("font", &Style::font); + add("font", &Loader::font); add("font_color", &Loader::font_color); + add("font_size", &Style::font_size); add("part", static_cast(&Loader::part)); add("part", static_cast(&Loader::part)); // Deprecated alias add("special", static_cast(&Loader::part)); } +void Style::Loader::font(const string &n) +{ + style.font = &res.get(n); + style.font_size = style.font->get_native_size(); +} + void Style::Loader::font_color(float r, float g, float b) { style.font_color = GL::Color(r, g, b);