forked from solvespace/solvespace
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathttf.h
More file actions
41 lines (32 loc) · 1.1 KB
/
ttf.h
File metadata and controls
41 lines (32 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//-----------------------------------------------------------------------------
// Routines to read a TrueType font as vector outlines, and generate them
// as entities, since they're always representable as either lines or
// quadratic Bezier curves.
//
// Copyright 2016 whitequark, Peter Barfuss.
//-----------------------------------------------------------------------------
#ifndef __TTF_H
#define __TTF_H
class TtfFont {
public:
std::string fontFile;
std::string name;
FT_FaceRec_ *fontFace;
double capHeight;
std::string FontFileBaseName() const;
bool LoadFromFile(FT_LibraryRec_ *fontLibrary, bool nameOnly = true);
void PlotString(const std::string &str,
SBezierList *sbl, Vector origin, Vector u, Vector v);
};
class TtfFontList {
public:
FT_LibraryRec_ *fontLibrary;
bool loaded;
List<TtfFont> l;
TtfFontList();
~TtfFontList();
void LoadAll();
void PlotString(const std::string &font, const std::string &str,
SBezierList *sbl, Vector origin, Vector u, Vector v);
};
#endif