Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(932)

Unified Diff: cmd/print-glyph-points/main.c

Issue 40690045: code review 40690045: freetype/truetype: add testdata for advance widths and ... (Closed)
Patch Set: diff -r b59b8c2ec13c https://code.google.com/p/freetype-go Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | freetype/truetype/truetype_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/print-glyph-points/main.c
===================================================================
--- a/cmd/print-glyph-points/main.c
+++ b/cmd/print-glyph-points/main.c
@@ -14,6 +14,7 @@
FT_Error error;
FT_Library library;
FT_Face face;
+ FT_Glyph_Metrics* m;
FT_Outline* o;
FT_Int major, minor, patch;
int i, j, font_size, no_hinting;
@@ -64,6 +65,15 @@
fprintf(stderr, "glyph format for glyph %d is not FT_GLYPH_FORMAT_OUTLINE\n", i);
return 1;
}
+ m = &face->glyph->metrics;
+ /* Print what Go calls the AdvanceWidth, and then: XMin, YMin, XMax, YMax. */
+ printf("%ld %ld %ld %ld %ld;",
+ m->horiAdvance,
+ m->horiBearingX,
+ m->horiBearingY - m->height,
+ m->horiBearingX + m->width,
+ m->horiBearingY);
+ /* Print the glyph points. */
o = &face->glyph->outline;
for (j = 0; j < o->n_points; j++) {
if (j != 0) {
« no previous file with comments | « no previous file | freetype/truetype/truetype_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b