static void MVInline(MetricsView *mv, real width, real inset) { StrokeInfo si; SplineSet *temp, *spl, *temp2; int i, changed; memset(&si,0,sizeof(si)); si.removeexternal = true; /* si.removeoverlapifneeded = true;*/ for ( i=mv->glyphcnt-1; i>=0; --i ) if ( mv->perchar[i].selected ) break; if ( i!=-1 ) { SplineChar *sc = mv->glyphs[i].sc; SCPreserveLayer(sc,mv->layer,false); si.radius = width; temp = SplineSetStroke(sc->layers[mv->layer].splines,&si,sc->layers[mv->layer].order2); si.radius = width+inset; temp2 = SplineSetStroke(sc->layers[mv->layer].splines,&si,sc->layers[mv->layer].order2); for ( spl=sc->layers[mv->layer].splines; spl->next!=NULL; spl=spl->next ); spl->next = temp; for ( ; spl->next!=NULL; spl=spl->next ); spl->next = temp2; SplineSetsCorrect(sc->layers[mv->layer].splines,&changed); SCCharChangedUpdate(sc,mv->layer); } }
void FVOutline(FontViewBase * fv, real width) { StrokeInfo si; SplineSet *temp, *spl; int i, cnt=0, changed, gid; SplineChar *sc; int layer=fv->active_layer; for (i=0; i < fv->map->enccount; ++i) if ((gid=fv->map->map[i]) != -1 && (sc=fv->sf->glyphs[gid]) != NULL && fv->selected[i] && sc->layers[layer].splines) ++cnt; memset(&si, 0, sizeof(si)); si.removeexternal=true; si.radius=width; /*si.removeoverlapifneeded=true; */ SFUntickAll(fv->sf); for (i=0; i < fv->map->enccount; ++i) if ((gid=fv->map->map[i]) != -1 && (sc=fv->sf->glyphs[gid]) != NULL && fv->selected[i] && sc->layers[layer].splines && !sc->ticked) { sc->ticked=true; SCPreserveLayer(sc, layer, false); temp = SplineSetStroke(sc->layers[layer].splines, &si, sc->layers[layer].order2); for (spl=sc->layers[layer].splines; spl->next != NULL; spl=spl->next); spl->next=temp; SplineSetsCorrect(sc->layers[layer].splines, &changed); SCCharChangedUpdate(sc, layer, true); } }
static void MVShadow(MetricsView *mv,real angle, real outline_width, real shadow_length,int wireframe) { int i; for ( i=mv->glyphcnt-1; i>=0; --i ) if ( mv->perchar[i].selected ) break; if ( i!=-1 ) { SplineChar *sc = mv->glyphs[i].sc; SCPreserveLayer(sc,mv->layer,false); sc->layers[mv->layer].splines = SSShadow(sc->layers[mv->layer].splines,angle,outline_width,shadow_length,sc,wireframe); SCCharChangedUpdate(sc,mv->layer); } }
void FVInline(FontViewBase *fv, real width, real inset) { StrokeInfo si; SplineSet *temp, *spl, *temp2; int i, cnt=0, changed, gid; SplineChar *sc; int layer = fv->active_layer; for ( i=0; i<fv->map->enccount; ++i ) if ( (gid=fv->map->map[i])!=-1 && (sc=fv->sf->glyphs[gid])!=NULL && fv->selected[i] && sc->layers[layer].splines ) ++cnt; ff_progress_start_indicator(10,_("Inlining glyphs"),_("Inlining glyphs"),0,cnt,1); memset(&si,0,sizeof(si)); si.removeexternal = true; /*si.removeoverlapifneeded = true;*/ SFUntickAll(fv->sf); for ( i=0; i<fv->map->enccount; ++i ) if ( (gid=fv->map->map[i])!=-1 && (sc=fv->sf->glyphs[gid])!=NULL && fv->selected[i] && sc->layers[layer].splines && !sc->ticked ) { sc->ticked = true; SCPreserveLayer(sc,layer,false); si.radius = width; temp = SplineSetStroke(sc->layers[layer].splines,&si,sc->layers[layer].order2); si.radius = width+inset; temp2 = SplineSetStroke(sc->layers[layer].splines,&si,sc->layers[layer].order2); for ( spl=sc->layers[layer].splines; spl->next!=NULL; spl=spl->next ); spl->next = temp; for ( ; spl->next!=NULL; spl=spl->next ); spl->next = temp2; SplineSetsCorrect(sc->layers[layer].splines,&changed); SCCharChangedUpdate(sc,layer); if ( !ff_progress_next()) break; } ff_progress_end_indicator(); }
static void RH_MovePoints(ReviewHintData *hd,StemInfo *active,int start,int width) { SplineChar *sc = hd->cv->b.sc; SplineSet *spl; SplinePoint *sp; int which; int layer = CVLayer( (CharViewBase *) (hd->cv)); if ( !hd->undocreated ) { SCPreserveLayer(sc,layer,true); hd->undocreated = true; } for ( spl=sc->layers[layer].splines; spl!=NULL; spl=spl->next ) { for ( sp = spl->first ; ; ) { if ( hd->ishstem ) { switch ((which = OnHint(active,sp->me.y,sp->me.x)) ) { case 1: sp->nextcp.y += start-sp->me.y; sp->prevcp.y += start-sp->me.y; sp->me.y = start; break; case 2: sp->nextcp.y += start+width-sp->me.y; sp->prevcp.y += start+width-sp->me.y; sp->me.y = start+width; break; case 0: /* Not on hint */; break; } } else { switch ( (which = OnHint(active,sp->me.x,sp->me.y)) ) { case 1: sp->nextcp.x += start-sp->me.x; sp->prevcp.x += start-sp->me.x; sp->me.x = start; break; case 2: sp->nextcp.x += start+width-sp->me.x; sp->prevcp.x += start+width-sp->me.x; sp->me.x = start+width; break; case 0: /* Not on hint */; break; } } if ( which ) { if ( sp->prev ) SplineRefigure(sp->prev); if ( sp->next ) SplineRefigure(sp->next); } if ( sp->next==NULL ) break; sp = sp->next->to; if ( sp== spl->first ) break; } } }