Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 gcc main.c -I/usr/include/freetype2 -lfreetype && ./a.out 12 ../../testdata/luxi sr.ttf with_hinting | 2 gcc main.c -I/usr/include/freetype2 -lfreetype && ./a.out 12 ../../testdata/luxi sr.ttf with_hinting |
3 */ | 3 */ |
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <ft2build.h> | 6 #include <ft2build.h> |
7 #include FT_FREETYPE_H | 7 #include FT_FREETYPE_H |
8 | 8 |
9 void usage(char** argv) { | 9 void usage(char** argv) { |
10 printf("usage: %s font_size font_file [with_hinting|sans_hinting]\n", ar gv[0]); | 10 printf("usage: %s font_size font_file [with_hinting|sans_hinting]\n", ar gv[0]); |
bsiegert
2013/10/05 16:28:07
no_hinting?
nigeltao
2013/10/05 21:56:22
"sans" matches the filename and the truetype_test.
| |
11 } | 11 } |
12 | 12 |
13 int main(int argc, char** argv) { | 13 int main(int argc, char** argv) { |
14 FT_Error error; | 14 FT_Error error; |
15 FT_Library library; | 15 FT_Library library; |
16 FT_Face face; | 16 FT_Face face; |
17 FT_Outline* o; | 17 FT_Outline* o; |
18 int i, j, font_size, no_hinting; | 18 int i, j, font_size, no_hinting; |
19 | 19 |
20 if (argc != 4) { | 20 if (argc != 4) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 } | 63 } |
64 o = &face->glyph->outline; | 64 o = &face->glyph->outline; |
65 for (j = 0; j < o->n_points; j++) { | 65 for (j = 0; j < o->n_points; j++) { |
66 if (j != 0) { | 66 if (j != 0) { |
67 printf(", "); | 67 printf(", "); |
68 } | 68 } |
69 printf("%ld %ld %d", o->points[j].x, o->points[j].y, o-> tags[j] & 0x01); | 69 printf("%ld %ld %d", o->points[j].x, o->points[j].y, o-> tags[j] & 0x01); |
70 } | 70 } |
71 printf("\n"); | 71 printf("\n"); |
72 } | 72 } |
73 return 0; | |
73 } | 74 } |
LEFT | RIGHT |