Index: work/util/ttf2lht/Makefile =================================================================== --- work/util/ttf2lht/Makefile (nonexistent) +++ work/util/ttf2lht/Makefile (revision 18919) @@ -0,0 +1,4 @@ +CFLAGS = -Wall -g -I/usr/include/freetype2 +LDFLAGS = -lfreetype + +ttf2lht: ttf2lht.c Index: work/util/ttf2lht/ttf2lht.c =================================================================== --- work/util/ttf2lht/ttf2lht.c (nonexistent) +++ work/util/ttf2lht/ttf2lht.c (revision 18919) @@ -0,0 +1,39 @@ +#include +#include +#include + +FT_Library library; +FT_Face face; + +int main(int argc, char *argv[]) +{ + char *fontname = "FreeMono.ttf"; + FT_Error errnum; +# undef __FTERRORS_H__ +# define FT_ERRORDEF( e, v, s ) { e, s }, +# define FT_ERROR_START_LIST { +# define FT_ERROR_END_LIST { 0, 0 } }; + static const struct { + FT_Error errnum; + const char *errstr; + } ft_errtab[] = +# include FT_ERRORS_H + + errnum = FT_Init_FreeType(&library); + if (errnum != 0) { + fprintf(stderr, "FT_Init_FreeType: %s\n", ft_errtab[errnum].errstr); + return 1; + } + + errnum = FT_New_Face(library, fontname, 0, &face); + if (errnum != 0) { + fprintf(stderr, "FT_New_Face: %s\n", ft_errtab[errnum].errstr); + return 1; + } + + fprintf(stderr, "Family: %s\n", face->family_name); + fprintf(stderr, "Height=%d ascender=%d descender=%d\n", face->height, face->ascender, face->descender); + + + return 0; +} \ No newline at end of file