2011-12-14 00:23:17 +03:00
|
|
|
#pragma once
|
2011-03-15 16:35:36 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* FontBase.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum EFonts
|
|
|
|
{
|
|
|
|
FONT_BIG, FONT_CALLI, FONT_CREDITS, FONT_HIGH_SCORE, FONT_MEDIUM, FONT_SMALL, FONT_TIMES, FONT_TINY, FONT_VERD
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Font
|
|
|
|
{
|
|
|
|
struct Char
|
|
|
|
{
|
2012-05-18 20:35:46 +03:00
|
|
|
si32 leftOffset, width, rightOffset;
|
2011-12-14 00:23:17 +03:00
|
|
|
ui8 *pixels;
|
2011-03-15 16:35:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Char chars[256];
|
|
|
|
ui8 height;
|
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
ui8 *data;
|
2011-03-15 16:35:36 +02:00
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
Font(ui8 *Data);
|
2011-03-15 16:35:36 +02:00
|
|
|
~Font();
|
|
|
|
int getWidth(const char *text) const;
|
|
|
|
int getCharWidth(char c) const;
|
|
|
|
};
|