00001 00005 /* Copyright © 2009 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 #include "BasicFonts.h" 00012 00013 #include <iostream> 00014 00015 namespace UI 00016 { 00017 00018 BasicFonts::~BasicFonts() 00019 { 00020 } 00021 BasicFonts::BasicFonts() 00022 : 00023 small_font("data/ui/FreeSans.ttf"), 00024 big_font("data/ui/FreeSans.ttf") 00025 { 00026 if (small_font.Error() || big_font.Error()) 00027 { 00028 // Font didn't load properly. 00029 std::cerr << "Cannot load font data/ui/FreeSans.ttf\n"; 00030 throw; 00031 } 00032 small_font.FaceSize(14); 00033 small_font.UseDisplayList(true); 00034 small_font.CharMap(ft_encoding_unicode); 00035 00036 big_font.FaceSize(24); 00037 big_font.UseDisplayList(true); 00038 big_font.CharMap(ft_encoding_unicode); 00039 } 00040 00041 BasicFonts & BasicFonts::get_instance() 00042 { 00043 static BasicFonts * fonts = new BasicFonts; 00044 return *fonts; 00045 } 00046 00047 }
Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.