forked from kv01/ttf-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
glyph geometry in a more usable form
- Loading branch information
kv01
committed
Dec 4, 2021
1 parent
8a95cba
commit 065fcd9
Showing
6 changed files
with
94 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
# ttf-parser | ||
A bare-bones, single header file ttf font parser written in C++ for fast GPU font rendering. | ||
A bare-bones, single header file ttf font parser for font rendering. | ||
|
||
## How to use | ||
* Define TTF_FONT_PARSER_IMPLEMENTATION in ONE cpp file to enable the implementation in the header file. | ||
* Use *parse_file* or *parse_data* to get a *FontData* structure with all font metrics and glyph data needed for rendering common fonts. | ||
* Note that *parse_file* is currently synchronous except when compiled with emscripten but will still execute the callback | ||
* *parse_file* is currently synchronous except when compiled with emscripten but will still execute the callback | ||
|
||
A glyph is represented as a set of triangles (p_x, p1, p2) where p_x is the center of the glyph and | ||
p1 and p2 are sequential points on the curve. Quadratic splines will have 2 tiangles associated with them, | ||
(p_x, p1, p2) as before and (p1, p_c, p2) where p_c is the spline control point. | ||
Glyph geometry is a set of lines and quadratic curves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.