printf("face num_glyphs = %d\n",
face->num_glyphs);
printf("face xmax = %d\n",
face->bbox.xMax);
printf("face xmin = %d\n",
face->bbox.xMin);
printf("face ymax = %d\n",
face->bbox.yMax);
printf("face ymin = %d\n",
face->bbox.yMin);
printf("face units_per_em = %d\n",
face->units_per_EM);
for (j=0;
j<face->num_charmaps; j++)
printf("platform_id =
%d encoding_id =
%d\n",
face->charmaps[j]->platform_id,
face->charmaps[j]->encoding_id);
/* For each character in the
specified range, generate a 3D polygonal mesh
for
the character glyph. */
for (j=minChar; j<=maxChar; j++)
{
glyph_index = FT_Get_Char_Index( face, j
);
if (glyph_index > 0)
{
FT_Get_Glyph_Name( face, glyph_index,
buffer, 100);
printf("glyph name = '%s'\n",
buffer);
error = FT_Load_Glyph( face,
glyph_index, FT_LOAD_DEFAULT);
if
(error == 0)
{
error = FT_Get_Glyph(
face->glyph, &glyph);
if
(error == 0)
create3dGlyph( glyph );
}
}
}
/*-------------------------------------------------------------------*/
int
create3dGlyph(FT_Glyph
glyph)
{
#define MAX_CONTOURS 50
int
startIndex;
int
endIndex;
contourStruct
contours[MAX_CONTOURS];
edgeStruct
edges[MAX_CONTOURS];
int
j, k;
unsigned long
x;
FT_OutlineGlyph
outlineGlyph;
FT_Outline
outline;
FT_GlyphRec
root;
outlineGlyph = (FT_OutlineGlyph)
glyph;
root = outlineGlyph->root;
outline = outlineGlyph->outline;
x = (unsigned long)
root.format;
printf("format = %c%c%c%c\n", (x >> 24), (x
>> 16 &
0x000000FF),
(x >> 8 & 0x000000FF), (x & 0x000000FF) );
printf("advance = %ld %ld\n", root.advance.x, root.advance.y);
printf("number of contours = %hd\n", outline.n_contours);
printf("number of points = %hd\n", outline.n_points);
printf("size of n_contours = %d\n", sizeof(outline.n_contours));
printf("size of points x = %d\n", sizeof(outline.points[0].x));
printf("size of points y = %d\n",
sizeof(outline.points[0].y));
printf("points tags
contours\n");
for (j=0; j<outline.n_points;
j++)
printf("%3d %6ld %6ld %d\n",
j,
outline.points[j].x,
outline.points[j].y,
outline.tags[j]);
for (j=0; j<outline.n_contours;
j++)
printf("Contour %d ends at %hd\n", j,
outline.contours[j]);
printf("flags = %d\n",
outline.flags);
DUMP OF
OUTPUT (for '2' in the
arial.ttf file)
FT_New_Face
error
0
FT_FACE_FLAG_SCALABLE
FT_FACE_FLAG_SFNT
FT_FACE_FLAG_HORIZONTAL
FT_FACE_FLAG_KERNING
FT_FACE_FLAG_GLYPH_NAMES
face
num_glyphs = 1320
face xmax = 4154
face xmin =
-1361
face ymax = 2060
face ymin =
-665
face units_per_em = 2048
platform_id = 0 encoding_id =
3
platform_id = 1 encoding_id = 0
platform_id = 3 encoding_id
= 1
glyph name = 'two'
format = outl
advance = 65536 0
number of
contours = 1
number of points = 31
size of n_contours =
2
size of points x = 4
size of points y = 4
points tags
contours
0 64
64 1
1
64 0 1
2 0
0 1
3
0 24 0
4 0 46
1
5 0
64 0
6
0 64 0
7 0 64
1
8 0
64 0
9
0 64
0
10 0
64 1
11
0 64
0
12 0
64 0
13
0 64
1
14 0
64 0
15
0 64
0
16 0
64 1
17
0 64
1
18 0
64 0
19
0 64
0
20 0
64 1
21
0 64
0
22 64
64 0
23
64 64
1
24 64
64 0
25
64 64
0
26 0
64 0
27
0 64
1
28 0
64 0
29
0 64
0
30 0
64 1
Contour 0 ends at 30
flags = 1
Wayne Brown, Assistant Professor
Department of Computer Science
United States Air Force
Academy
Phone: 719-333-3131
FAX:
719-333-3338
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Devel] Help with outlines of fonts,
Brown Wayne C Civ USAFA/DFCS <=