SuperTuxKart
digit_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_DIGIT_FACE_HPP
20 #define HEADER_DIGIT_FACE_HPP
21 
22 #include "font/font_with_face.hpp"
23 
24 class FaceTTF;
25 
29 class DigitFace : public FontWithFace
30 {
31 private:
32  virtual bool supportLazyLoadChar() const OVERRIDE { return false; }
33  // ------------------------------------------------------------------------
34  virtual unsigned int getGlyphPageSize() const OVERRIDE { return 256; }
35  // ------------------------------------------------------------------------
36  virtual float getScalingFactorOne() const OVERRIDE { return 0.7f; }
37  // ------------------------------------------------------------------------
38  virtual unsigned int getScalingFactorTwo() const OVERRIDE { return 40; }
39 
40 public:
41  LEAK_CHECK()
42  // ------------------------------------------------------------------------
43  DigitFace();
44  // ------------------------------------------------------------------------
45  virtual void init() OVERRIDE;
46  // ------------------------------------------------------------------------
47  virtual void reset() OVERRIDE;
48  // ------------------------------------------------------------------------
49  virtual bool disableTextShaping() const OVERRIDE { return true; }
50 }; // DigitFace
51 
52 #endif
53 /* EOF */
This class will load a list of TTF files from FontManager, and save them inside m_ft_faces for FontWi...
Definition: face_ttf.hpp:56
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: digit_face.hpp:34
virtual float getScalingFactorOne() const OVERRIDE
Defined by sub-class about the scaling factor 1.
Definition: digit_face.hpp:36
DigitFace()
Constructor of DigitFace.
Definition: digit_face.cpp:25
A font which uses a more cartonish style TTF to render big numbers in STK.
Definition: digit_face.hpp:29
An abstract class which contains functions which convert vector fonts into bitmap and render them in ...
Definition: font_with_face.hpp:55
virtual void reset() OVERRIDE
Clear all the loaded characters, sub-class can do pre-loading of characters after this...
Definition: digit_face.cpp:38
virtual unsigned int getScalingFactorTwo() const OVERRIDE
Defined by sub-class about the scaling factor 2.
Definition: digit_face.hpp:38
virtual bool supportLazyLoadChar() const OVERRIDE
Override it if sub-class should not do lazy loading characters.
Definition: digit_face.hpp:32
virtual void init() OVERRIDE
Initialize the font structure, but don't load glyph here.
Definition: digit_face.cpp:30