14 static struct GlftWalkState state;
16 int GlftMoveToFunc(FT_Vector *to, void *user)
18 state.x = (to->x >> 6) + (to->x & 63)/64;
19 state.y = (to->y >> 6) + (to->y & 63)/64;
20 printf("move to %f:%f\n", state.x, state.y);
28 int GlftLineToFunc(FT_Vector *to, void *user)
32 glVertex2f(state.x, state.y);
34 state.x = (to->x >> 6) + (to->x & 63)/64;
35 state.y = (to->y >> 6) + (to->y & 63)/64;
36 printf("line to %f:%f\n", state.x, state.y);
37 glVertex2f(state.x, state.y);
41 int GlftConicToFunc(FT_Vector *c, FT_Vector *to, void *user)
43 GlftLineToFunc(to, user);
44 printf("conic the hedgehog!\n");
48 int GlftCubicToFunc(FT_Vector *c1, FT_Vector *c2, FT_Vector *to, void
51 GlftLineToFunc(to, user);
56 FT_Outline_Funcs GlftFuncs = {
65 void GlftRenderGlyph(FT_Face face, unsigned int dlist)
68 FT_GlyphSlot slot = face->glyph;
74 glNewList(dlist, GL_COMPILE);
75 err = FT_Outline_Decompose(&slot->outline, &GlftFuncs, NULL);
82 void GlftRenderString(struct GlftFont *font, const char *str, int bytes,
88 if (!g_utf8_validate(str, bytes, NULL)) {
89 GlftDebug("Invalid UTF-8 in string\n");
97 g = GlftFontGlyph(font, c);
100 glTranslatef(g->width, 0.0, 0.0);
102 glTranslatef(font->max_advance_width, 0.0, 0.0);
103 c = g_utf8_next_char(c);
104 if (c - str >= bytes) break;