Index: work/util/ttf2lht/ttf2lht.c =================================================================== --- work/util/ttf2lht/ttf2lht.c (revision 18921) +++ work/util/ttf2lht/ttf2lht.c (revision 18922) @@ -12,27 +12,35 @@ "Need an outline font" }; +typedef struct { + int x, y; + FT_Outline_Funcs *funcs; +} stroke_t; -int stroke_move_to(const FT_Vector *to, void *fp) +int stroke_move_to(const FT_Vector *to, void *s_) { + stroke_t *s = (stroke_t *)s_; printf("# move to\n"); return 0; } -int stroke_line_to(const FT_Vector *to, void *fp) +int stroke_line_to(const FT_Vector *to, void *s_) { + stroke_t *s = (stroke_t *)s_; printf("# line to\n"); return 0; } -int stroke_conic_to(const FT_Vector *control, const FT_Vector *to, void *fp) +int stroke_conic_to(const FT_Vector *control, const FT_Vector *to, void *s_) { + stroke_t *s = (stroke_t *)s_; printf("# conic to\n"); return 0; } -int stroke_cubic_to(const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, void *fp) +int stroke_cubic_to(const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, void *s_) { + stroke_t *s = (stroke_t *)s_; printf("# cubic to\n"); return 0; } @@ -53,6 +61,7 @@ FT_Error err; FT_Glyph gly; FT_OutlineGlyph ol; + stroke_t str; // load glyph err = FT_Load_Glyph(face, FT_Get_Char_Index(face, chr), FT_LOAD_NO_BITMAP | FT_LOAD_NO_SCALE); @@ -64,7 +73,8 @@ if (face->glyph->format != ft_glyph_format_outline) return -1; - err = FT_Outline_Decompose(&(ol->outline), &funcs, NULL); + str.funcs = &funcs; + err = FT_Outline_Decompose(&(ol->outline), &funcs, &str); if (err != 0) return err;