2012-02-15 13:53:13 -08:00
|
|
|
/* Copyright (C) 2012 Wildfire Games.
|
2009-04-18 10:00:33 -07:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-05-07 09:33:24 -07:00
|
|
|
#ifndef INCLUDED_FONT
|
|
|
|
|
#define INCLUDED_FONT
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2004-10-06 07:12:10 -07:00
|
|
|
#include "lib/res/handle.h"
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2007-01-13 14:44:42 -08:00
|
|
|
class CStrW;
|
2012-02-15 13:53:13 -08:00
|
|
|
struct UnifontGlyphData;
|
2004-08-27 15:08:30 -07:00
|
|
|
|
|
|
|
|
class CFont
|
|
|
|
|
{
|
|
|
|
|
public:
|
2011-02-17 12:08:20 -08:00
|
|
|
CFont(const CStrW& name);
|
2004-08-27 15:08:30 -07:00
|
|
|
~CFont();
|
|
|
|
|
|
2012-01-29 16:27:23 -08:00
|
|
|
bool HasRGB();
|
2004-08-27 15:08:30 -07:00
|
|
|
int GetLineSpacing();
|
2004-10-14 03:10:43 -07:00
|
|
|
int GetHeight();
|
2005-12-12 11:19:30 -08:00
|
|
|
int GetCharacterWidth(wchar_t c);
|
2012-02-25 09:14:47 -08:00
|
|
|
void CalculateStringSize(const wchar_t* string, int& w, int& h);
|
2012-02-15 13:53:13 -08:00
|
|
|
const std::map<u16, UnifontGlyphData>& GetGlyphs();
|
|
|
|
|
Handle GetTexture();
|
2004-08-27 15:08:30 -07:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Handle h;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 09:33:24 -07:00
|
|
|
#endif // INCLUDED_FONT
|