From 51fd0d0fe7ad8a617de8f71985e0c4cb60fec3a9 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 8 Dec 2012 02:03:50 +0200 Subject: [PATCH] Font size loading fixes When a font is specified, reset font size as well. Add a font_size statement for overriding the size. --- source/style.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.43.0