SuperTuxKart
Loading...
Searching...
No Matches
bold_face.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2016 SuperTuxKart-Team
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_BOLD_FACE_HPP
20#define HEADER_BOLD_FACE_HPP
21
22#include "font/font_with_face.hpp"
23
24class FaceTTF;
25
30class BoldFace : public FontWithFace
31{
32private:
33 virtual unsigned int getGlyphPageSize() const OVERRIDE { return 512; }
34 // ------------------------------------------------------------------------
35 virtual float getScalingFactorOne() const OVERRIDE { return 0.3f; }
36 // ------------------------------------------------------------------------
37 virtual unsigned int getScalingFactorTwo() const OVERRIDE { return 120; }
38 // ------------------------------------------------------------------------
39 virtual bool isBold() const OVERRIDE { return true; }
40 // ------------------------------------------------------------------------
41#ifndef SERVER_ONLY
42 virtual int shapeOutline(FT_Outline* outline) const OVERRIDE;
43#endif
44
45public:
46 LEAK_CHECK()
47 // ------------------------------------------------------------------------
48 BoldFace();
49 // ------------------------------------------------------------------------
50 virtual void init() OVERRIDE;
51 // ------------------------------------------------------------------------
52 virtual void reset() OVERRIDE;
53
54}; // BoldFace
55
56#endif
57/* EOF */
A font which uses regular TTFs to render title or important message in STK with a bold outline,...
Definition: bold_face.hpp:31
virtual float getScalingFactorOne() const OVERRIDE
Defined by sub-class about the scaling factor 1.
Definition: bold_face.hpp:35
virtual int shapeOutline(FT_Outline *outline) const OVERRIDE
Embolden the glyph to make bold font using FT_Outline_Embolden.
Definition: bold_face.cpp:65
virtual unsigned int getGlyphPageSize() const OVERRIDE
Defined by sub-class about the texture size of glyph page, it should be a power of two.
Definition: bold_face.hpp:33
virtual unsigned int getScalingFactorTwo() const OVERRIDE
Defined by sub-class about the scaling factor 2.
Definition: bold_face.hpp:37
virtual void init() OVERRIDE
Initialize the font structure, but don't load glyph here.
Definition: bold_face.cpp:32
virtual void reset() OVERRIDE
Clear all the loaded characters, sub-class can do pre-loading of characters after this.
Definition: bold_face.cpp:45
virtual bool isBold() const OVERRIDE
Override it if sub-class has bold outline.
Definition: bold_face.hpp:39
This class will load a list of TTF files from FontManager, and save them inside m_ft_faces for FontWi...
Definition: face_ttf.hpp:57
An abstract class which contains functions which convert vector fonts into bitmap and render them in ...
Definition: font_with_face.hpp:72