ScummVM API documentation
tt_font.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ULTIMA8_GFX_FONTS_TTFONT_H
23#define ULTIMA8_GFX_FONTS_TTFONT_H
24
25#include "ultima/ultima8/gfx/fonts/font.h"
26#include "graphics/font.h"
27#include "graphics/pixelformat.h"
28
29namespace Ultima {
30namespace Ultima8 {
31
32class TTFont : public Font {
33public:
34 TTFont(Graphics::Font *font, uint32 rgb, int bordersize,
35 bool antiAliased, bool SJIS);
36 ~TTFont() override;
37
38 int getHeight() override;
39 int getBaseline() override;
40 int getBaselineSkip() override;
41
42 bool isAntialiased() {
43 return _antiAliased;
44 }
45
46 void getStringSize(const Common::String &text,
47 int32 &width, int32 &height) override;
48
49 void getTextSize(const Common::String &text,
50 int32 &resultwidth, int32 &resultheight, unsigned int &remaining,
51 int32 width = 0, int32 height = 0, TextAlign align = TEXT_LEFT,
52 bool u8specials = false, bool pagebreaks = false) override;
53
55 unsigned int &remaining, int32 width = 0, int32 height = 0,
56 TextAlign align = TEXT_LEFT, bool u8specials = false,
57 bool pagebreaks = false,
58 Common::String::size_type cursor = Common::String::npos) override;
59
60protected:
61 Graphics::Font *_ttfFont;
62 uint32 _color;
63 int _borderSize;
64 bool _antiAliased;
65 bool _SJIS;
66 Graphics::PixelFormat _PF_RGBA;
67
68 uint16 _bullet;
69
70 void addTextBorder(Graphics::ManagedSurface &textSurf, uint32 *texBuf, const Common::Rect32 &dims, int32 resultWidth, int32 resultHeight, uint32 borderColor);
71};
72
73} // End of namespace Ultima8
74} // End of namespace Ultima
75
76#endif
Definition: str.h:59
Definition: font.h:83
Definition: managed_surface.h:51
Definition: font.h:41
Definition: rendered_text.h:32
Definition: tt_font.h:32
void getTextSize(const Common::String &text, int32 &resultwidth, int32 &resultheight, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false) override
void getStringSize(const Common::String &text, int32 &width, int32 &height) override
int getBaseline() override
get the baseline of the font (relative from the top)
RenderedText * renderText(const Common::String &text, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false, Common::String::size_type cursor=Common::String::npos) override
int getBaselineSkip() override
get the baselineskip of the font (distance between two baselines)
int getHeight() override
get the height of the font
Definition: rect.h:538
Definition: pixelformat.h:138