Cobbletext  0.2.0
Complex text layout and rendering engine
Library.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <stdint.h>
6 
7 #include "common.hpp"
8 #include "macros.h"
9 #include "FontInfo.hpp"
10 #include "GlyphInfo.hpp"
11 
12 namespace cobbletext {
13 
14 
16  static std::string version_;
17 
18 public:
19  static int32_t versionMajor();
20  static int32_t versionMinor();
21  static int32_t versionPatch();
22  static std::string version();
23 
24  friend class Engine;
25 
26  Library();
27  ~Library();
28 
29  FontID fallbackFont();
30 
31  FontID loadFont(const std::string path);
32 
33  FontID loadFontBytes(const uint8_t * bytes, size_t length,
34  int32_t faceIndex = 0);
35 
36  FontInfo getFontInfo(FontID id);
37 
38  GlyphInfo getGlyphInfo(GlyphID id);
39 
40  void setFontAlternative(FontID id, FontID fallbackID);
41 
42  FontID getFontAlternative(FontID id);
43 
44 private:
45  class Impl;
46  std::unique_ptr<Impl> impl;
47 };
48 
49 
50 }
common.hpp
GlyphInfo.hpp
cobbletext::Library
Definition: Library.hpp:15
macros.h
COBBLETEXT_CPP_API
#define COBBLETEXT_CPP_API
Macro for Windows C++ symbol import and export.
Definition: macros.h:33
FontInfo.hpp
cobbletext::Engine
Definition: Engine.hpp:21
cobbletext::GlyphInfo
Definition: GlyphInfo.hpp:11
cobbletext::FontID
uint32_t FontID
Definition: common.hpp:7
cobbletext::GlyphID
uint32_t GlyphID
Definition: common.hpp:8
cobbletext
Definition: AdvanceInfo.hpp:8
cobbletext::FontInfo
Definition: FontInfo.hpp:11