ScummVM API documentation
jp_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_JPFONT_H
23 #define ULTIMA8_GFX_FONTS_JPFONT_H
24 
25 #include "ultima/ultima8/gfx/fonts/font.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
30 class ShapeFont;
31 
32 class JPFont : public Font {
33 public:
34  JPFont(ShapeFont *jpfont, unsigned int fontnum);
35  ~JPFont() override;
36 
37  int getWidth(int c);
38 
39  int getHeight() override;
40  int getBaseline() override;
41  int getBaselineSkip() override;
42 
43  void getStringSize(const Std::string &text,
44  int32 &width, int32 &height) override;
45  void getTextSize(const Std::string &text, int32 &resultwidth,
46  int32 &resultheight, unsigned int &remaining, int32 width = 0,
47  int32 height = 0, TextAlign align = TEXT_LEFT,
48  bool u8specials = false, bool pagebreaks = false) override;
49 
50  RenderedText *renderText(const Std::string &text,
51  unsigned int &remaining, int32 width = 0, int32 height = 0,
52  TextAlign align = TEXT_LEFT, bool u8specials = false,
53  bool pagebreaks = false,
54  Std::string::size_type cursor = Std::string::npos) override;
55 
56 protected:
57 
58  unsigned int _fontNum;
59  ShapeFont *_shapeFont;
60 };
61 
62 } // End of namespace Ultima8
63 } // End of namespace Ultima
64 
65 #endif
Definition: font.h:41
Definition: shape_font.h:31
Definition: jp_font.h:32
RenderedText * renderText(const Std::string &text, unsigned int &remaining, int32 width=0, int32 height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, bool pagebreaks=false, Std::string::size_type cursor=Std::string::npos) override
void getStringSize(const Std::string &text, int32 &width, int32 &height) override
int getHeight() override
get the height of the font
Definition: rendered_text.h:30
Definition: detection.h:27
void getTextSize(const Std::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
Definition: string.h:30
int getBaselineSkip() override
get the baselineskip of the font (distance between two baselines)
int getBaseline() override
get the baseline of the font (relative from the top)