void CVGridFitChar(CharView *cv) { void *single_glyph_context; SplineFont *sf = cv->b.sc->parent; int layer = CVLayer((CharViewBase *) cv); SplinePointListsFree(cv->b.gridfit); cv->b.gridfit = NULL; FreeType_FreeRaster(cv->raster); cv->raster = NULL; single_glyph_context = _FreeTypeFontContext(sf,cv->b.sc,NULL,layer, sf->layers[layer].order2?ff_ttf:ff_otf,0,NULL); if ( single_glyph_context==NULL ) { LogError(_("Freetype rasterization failed.\n") ); return; } if ( cv->b.sc->layers[layer].refs!=NULL ) SCNumberPoints(cv->b.sc,layer); cv->raster = FreeType_GetRaster(single_glyph_context,cv->b.sc->orig_pos, cv->ft_pointsizey, cv->ft_pointsizex, cv->ft_dpi, cv->ft_depth ); cv->b.gridfit = FreeType_GridFitChar(single_glyph_context,cv->b.sc->orig_pos, cv->ft_pointsizey, cv->ft_pointsizex, cv->ft_dpi, &cv->b.ft_gridfitwidth, cv->b.sc, cv->ft_depth, true ); FreeTypeFreeContext(single_glyph_context); GDrawRequestExpose(cv->v,NULL,false); if ( cv->b.sc->instructions_out_of_date && cv->b.sc->ttf_instrs_len!=0 ) ff_post_notice(_("Instructions out of date"), _("The points have been changed. This may mean that the truetype instructions now refer to the wrong points and they may cause unexpected results.")); }
static void SCFindQuestionablePoints(struct qg_data *data) { uint16 width; SplineSet *gridfit = FreeType_GridFitChar(data->freetype_context, data->sc->orig_pos, data->cur_size, data->cur_size, data->dpi, &width, data->sc, data->depth, false); SplineSet *spl; Spline *s, *first; data->glyph_start = data->cur; for ( spl = gridfit; spl!=NULL; spl=spl->next ) { first = NULL; for ( s=spl->first->next; s!=first && s!=NULL; s = s->to->next ) { if ( first==NULL ) first = s; SplineFindQuestionablePoints(data,s); } } SplinePointListsFree(gridfit); }