From 4331f5c17901f46693dcb5c2df96276f6851be25 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 8 Oct 2008 18:28:21 +0000 Subject: libui updates, paint namespace, font and palette fixes, button sound --- src/ui/font.cc | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/ui/font.cc (limited to 'src/ui/font.cc') diff --git a/src/ui/font.cc b/src/ui/font.cc new file mode 100644 index 0000000..26d4155 --- /dev/null +++ b/src/ui/font.cc @@ -0,0 +1,57 @@ +/* + ui/font.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#include "ui/font.h" + +namespace ui { + +Font::Font(const char *name, const float width, const float height) +{ + if (name) + font_name.assign(name); + font_size.assign(width, height); +} + +Font::~Font() +{} + +void Font::set_size(const float width, const float height) +{ + font_size.assign(width, height); +} + +void Font::set_size(math::Vector2f const &size) +{ + font_size.assign(size); +} + +void Font::set_width(float width) +{ + font_size.x = width; +} + +void Font::set_height(float height) +{ + font_size.y = height; +} + +void Font::set_name(const char *name) +{ + if (name) + font_name.assign(name); + else + font_name.clear(); +} + +void Font::set_name(std::string const & name) +{ + font_name.assign(name); +} + +} + + + -- cgit v1.2.3