Hershey Vector Fonts 0.1.0
A C++ library for working with the Hershey vector fonts
Loading...
Searching...
No Matches
glyph.hpp
Go to the documentation of this file.
1#ifndef GLYPH_HPP
2#define GLYPH_HPP
3
8#include <fstream>
9#include <iostream>
10#include <string>
11
12namespace Hershey {
13
17class Glyph {
18
19 std::string raw;
20 int cid;
21 int lhp;
22 int rhp;
23 int nvert;
24 int height;
25 int width;
27 public:
28 int coords[144][2];
33 Glyph();
34
40 Glyph(std::string raw);
41
47 std::string get_raw();
48
54 int get_cid();
55
61 int get_lhp();
62
68 int get_rhp();
69
75 int get_nvert();
76
80 void print_info();
81
85 void print_coords();
86
91
97 int get_width();
98
104 int get_height();
105};
106} // namespace Hershey
107
108#endif
A Hershey vector font glyph.
Definition glyph.hpp:17
std::string get_raw()
Get the raw coordinate definition of the glyph.
Definition glyph.cpp:19
int get_height()
Get the character's height.
Definition glyph.cpp:68
Glyph()
Create a new glyph.
Definition glyph.cpp:5
int coords[144][2]
Definition glyph.hpp:28
int get_cid()
Get the character's unique identifier.
Definition glyph.cpp:23
void print_coords_nparray()
Print the character's vertices' coordinates in numpy array format.
Definition glyph.cpp:55
void print_info()
Print information about the character.
Definition glyph.cpp:39
int get_nvert()
Get the number of vertices making up the character.
Definition glyph.cpp:35
int get_width()
Get the character's width.
Definition glyph.cpp:64
int get_lhp()
Get the character's left-hand position.
Definition glyph.cpp:27
int get_rhp()
Get the character's right-hand position.
Definition glyph.cpp:31
void print_coords()
Print the character's vertices' coordinates in numpy array format.
Definition glyph.cpp:49