void LabelView::layout_children(Canvas &canvas) { View::layout_children(canvas); // Reset the font on new layout. reset_font(); }
void miscattrs(Attr *ap, struct objattr *obat) { float *fp; int n; switch (ap->a_type) { case FONT: reset_font((double)ap->a_val.f); break; case SIZE: reset_size(ap->a_sub, (double)ap->a_val.f); break; case SPACE: reset_space(ap->a_sub, (double)ap->a_val.f); break; case TEXTATTR: if (ap->a_val.p != NULL) savetext(ap->a_sub, ap->a_val.p); else /* These type values should be propagated back to other strings */ /* Maybe by calling reset_type, to be added to textgen.c */ text[ntext-1].t_type = ap->a_sub; /* ??? can this ever happen */ /* except after a previous */ /* text in the same object? */ break; case NOEDGE: obat->a_flags &= ~EDGED; break; case LAYER: obat->a_layer = ap->a_val.f; break; case LWEIGHT: obat->a_weight = ap->a_val.f; break; case LCOLOR: obat->a_lcolor = ap->a_val.f; break; case PCOLOR: obat->a_flags |= FILLED; if (ap->a_sub != DEFAULT) obat->a_pcolor = ap->a_val.f; break; case TCOLOR: obat->a_tcolor = ap->a_val.f; break; case DOT: case DASH: n = ap->a_type == DOT ? 3 : 2; if ((fp = (float *)malloc(n * sizeof(float))) == NULL) { yyerror("out of space in miscattrs"); break; } *fp = --n; fp[n] = (ap->a_sub == DEFAULT ? getfval("dashwid") : ap->a_val.f); if (n == 2) fp[1] = -1; /* fill in later, from weight */ ap->a_val.a = fp; /* and fall through to the general case */ case DASHPAT: obat->a_flags |= DOTDASH; obat->a_dashpat.a = ap->a_val.a; break; case HEIGHT: obat->a_ht = ap->a_val.f; break; case WIDTH: obat->a_wid = ap->a_val.f; break; case RADIUS: obat->a_rad = ap->a_val.f; break; case DIAMETER: obat->a_rad = ap->a_val.f / 2; break; } }