FontBase.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/debug.hpp>
10 #include <egami/Image.hpp>
11 #include <egami/ImageMono.hpp>
13 #include <gale/resource/Resource.hpp>
15 
16 
17 namespace ewol {
18  namespace resource {
19  class FontBase : public gale::Resource {
20  public:
21  FontBase() {
22  addResourceType("ewol::FontFreeType");
23  }
24  void init(const std::string& _fontName) {
25  gale::Resource::init(_fontName);
26  };
27 
28  virtual ~FontBase() { };
29 
30  virtual bool getGlyphProperty(int32_t _fontSize,
31  ewol::GlyphProperty& _property) = 0;
32 
33  virtual bool drawGlyph(egami::Image& _imageOut,
34  int32_t _fontSize,
35  ivec2 _glyphPosition,
36  ewol::GlyphProperty& _property,
37  int8_t _posInImage) = 0;
38 
39  virtual bool drawGlyph(egami::ImageMono& _imageOut,
40  int32_t _fontSize,
41  ewol::GlyphProperty& _property,
42  int32_t _borderSize = 0) = 0;
43 
44  virtual vec2 getSize(int32_t _fontSize, const std::string& _unicodeString) = 0;
45  virtual float getSizeWithHeight(float _fontHeight) = 0;
46 
47  virtual int32_t getHeight(int32_t _fontSize) = 0;
48 
49  virtual void generateKerning(int32_t _fontSize, std::vector<ewol::GlyphProperty>& _listGlyph) { };
50 
51  virtual void display() {};
52  };
53  };
54 };
55 
Definition: FontBase.hpp:19
Definition: Area.hpp:16
Definition: GlyphProperty.hpp:48