14 const GL::Font &Style::get_font() const
17 throw logic_error("!font");
21 const Part *Style::get_part(const string &name) const
23 for(PartSeq::const_iterator i=parts.begin(); i!=parts.end(); ++i)
24 if(i->get_name()==name)
31 Style::Loader::Loader(Style &s, Resources &r):
32 DataFile::CollectionObjectLoader<Style, Resources>(s, &r)
36 obj.font = &get_collection().get_default_font();
37 obj.font_size = obj.font->get_native_size();
40 add("font", &Loader::font);
41 add("font_color", &Loader::font_color);
42 add("font_size", &Style::font_size);
43 add("part", &Loader::part);
44 add("part", &Loader::unnamed_part);
47 void Style::Loader::font(const string &n)
49 obj.font = &get_collection().get<GL::Font>(n);
50 obj.font_size = obj.font->get_native_size();
53 void Style::Loader::font_color(float r, float g, float b)
55 obj.font_color = GL::Color(r, g, b);
58 void Style::Loader::part(const string &n)
61 load_sub(p, get_collection());
62 obj.parts.push_back(p);
65 void Style::Loader::unnamed_part()