static void readglyphs( GLYPH *glyph_list ) { int i; GLYPH *g; if(got_glyphs) return; /* pass them to handle_glyphs() through statics */ glyphs = glyph_list; curgl = 2; /* skip the empty glyph and .notdef */ /* initialize the empty glyph and .notdef */ for(i=0; i<2; i++) { g = &glyphs[i]; g->lsb = 0; g->width = fmet.bbox[2]; g->xMin = 0; g->yMin = 0; } g = &glyphs[0]; g->name = ".notdef"; g->xMax = fmet.bbox[2]*4/5; g->yMax = fmet.bbox[3]*4/5; g->entries = g->path = g->lastentry = 0; /* make it look as a black square */ fg_rmoveto(g, 0.0, 0.0); fg_rlineto(g, 0.0, (double)g->yMax); fg_rlineto(g, (double)g->xMax, (double)g->yMax); fg_rlineto(g, (double)g->xMax, 0.0); fg_rlineto(g, 0.0, 0.0); g_closepath(g); glpaths[0] = g->entries; g->entries = 0; g->ttf_pathlen = 4; g = &glyphs[1]; g->name = ".null"; g->xMax = g->yMax = 0; g->ttf_pathlen = 0; if(readfile(bdf_file, handle_glyphs) < 0) { fprintf(stderr, "**** file does not contain the ENDFONT line\n"); exit(1); } got_glyphs = 1; }
static int outl_moveto( FT_Vector *to, void *unused ) { double tox, toy; tox = fscale((double)to->x); toy = fscale((double)to->y); /* FreeType does not do explicit closepath() */ if(curg->lastentry) { g_closepath(curg); } fg_rmoveto(curg, tox, toy); lastx = tox; lasty = toy; return 0; }