[vtk-developers] Taming contrained font size in vtkTextMapper
jcplatt at lineone.net
Thu Jul 7 17:11:49 EDT 2005
The font size used in scalar bar and XY plots titles often becomes
excessive when only a small number of characters are involved. A simple
way to mitigate this is to set a font size ceiling on the vtkTextMapper
constrained font size methods.
Typical use for vtkXYPlotActor, for example, would be
The required changes are
// Set a ceiling on the font size determined by the constrained font
// methods. No ceiling is applied for a zero size (the default).
vtkSetClampMacro(FontSizeCeiling, int, 0, 100);
// No ceiling on the font size is applied on construction.
this->FontSizeCeiling = 0;
void vtkTextMapperEx::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "FontSizeCeiling: " << this->FontSizeCeiling << "\n";
before return insert
if ( this->FontSizeCeiling && fontSize > this->FontSizeCeiling
fontSize = this->FontSizeCeiling;
tprop->SetFontSize( this->FontSizeCeiling );
Some further work will be required to expose more of the text actors but
this gets the ball rolling.
If there are no obvious problems, I would really appreciate it if this
enhancement could be made.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers