Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
font.hpp
Go to the documentation of this file.
1#ifndef FONT_HPP
2#define FONT_HPP
3
8#include <fstream>
9#include <iostream>
10#include <string>
11
12#include "glyph.hpp"
13
14namespace Hershey {
15
19class Font {
20
21 std::string fname;
22 std::string name;
23 int num_glyphs = 0;
24 Glyph glyphs[98];
25 int baseline;
26 int descent;
27 int ascent;
28 int xheight;
30 private:
34 void load_font();
35
36 public:
40 Font();
41
47 Font(std::string name);
48
54 std::string get_fname();
55
61 std::string get_name();
62
68 int get_num_glyphs();
69
76 Glyph get_glyph(int i);
77
84 Glyph get_glyph(char c);
85};
86} // namespace Hershey
87
88#endif
A Hershey vector font.
Definition font.hpp:19
Font()
Create a new font.
Definition font.cpp:17
int get_num_glyphs()
Get the number of glyphs in the font.
Definition font.cpp:33
std::string get_name()
Get the font's name.
Definition font.cpp:29
std::string get_fname()
Get the font's filename.
Definition font.cpp:25
Glyph get_glyph(int i)
Get the i'th glyph in the font.
Definition font.cpp:37
A Hershey vector font glyph.
Definition glyph.hpp:17