I recommend that you use "MaximumFontSize" or "MaximumSize" instead of FontSizeCeiling. It's more consistent with existing VTK.<br>W<br><br><div class="gmail_quote">On Thu, May 15, 2008 at 3:56 AM, John Platt <<a href="mailto:jcplatt@dsl.pipex.com">jcplatt@dsl.pipex.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Ken,<br>
<br>
Another scaling mode which would be very useful...<br>
<br>
The font size used in scalar bar and XY plot titles often becomes<br>
excessive when only a small number of characters are involved. A simple<br>
way to mitigate this is to set a font size ceiling on the vtkTextMapper<br>
constrained font size methods.<br>
<br>
Typical use for vtkXYPlotActor, for example, would be<br>
myXYPlotActor->GetXAxisActor2D()->GetTitleMapper()->SetFontSizeCeiling(1<br>
2);<br>
<br>
The required changes are<br>
<br>
vtkTextMapper.h<br>
===============<br>
<br>
  // Description:<br>
  // Set a ceiling on the font size determined by the constrained font<br>
size<br>
  // methods. No ceiling is applied for a zero size (the default).<br>
  vtkSetClampMacro(FontSizeCeiling, int, 0, 100);<br>
  vtkGetMacro(FontSizeCeiling, int);<br>
<br>
protected:<br>
  int FontSizeCeiling;<br>
<br>
vtkTextMapper.cxx<br>
=================<br>
<br>
vtkTextMapper::vtkTextMapper()<br>
.<br>
  // No ceiling on the font size is applied on construction.<br>
  this->FontSizeCeiling = 0;<br>
<br>
<br>
void vtkTextMapper::PrintSelf(ostream& os, vtkIndent indent)<br>
.<br>
  os << indent << "FontSizeCeiling: " << this->FontSizeCeiling << "\n";<br>
<br>
<br>
int vtkTextMapper::SetConstrainedFontSize()<br>
<br>
 before return insert<br>
<br>
  if ( this->FontSizeCeiling && fontSize > this->FontSizeCeiling )<br>
  {<br>
     fontSize = this->FontSizeCeiling;<br>
     tprop->SetFontSize( this->FontSizeCeiling );<br>
  }<br>
<br>
Some further work would be required to expose more of the text actors<br>
but this gets the ball rolling. It would be very much appreciated if<br>
some functionality along these lines could be implemented.<br>
<br>
Many thanks,<br>
<font color="#888888"><br>
John.<br>
</font><div><div></div><div class="Wj3C7c"><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:vtk-developers-bounces@vtk.org">vtk-developers-bounces@vtk.org</a><br>
[mailto:<a href="mailto:vtk-developers-bounces@vtk.org">vtk-developers-bounces@vtk.org</a>] On Behalf Of Moreland, Kenneth<br>
Sent: 14 May 2008 23:52<br>
To: vtk-developpers<br>
Subject: [vtk-developers] New scaling mode for vtkTextActor<br>
<br>
Hi folks,<br>
<br>
I've been working on ParaView bug #6096<br>
(<a href="http://www.paraview.org/Bug/view.php?id=6096" target="_blank">http://www.paraview.org/Bug/view.php?id=6096</a>) and as part of the<br>
solution I would like to implement a new scaling mode to vtkTextActor.<br>
Right now, vtkTextActor can either used a fixed font or can scale the<br>
text to fit within the bounds of the prop.  I propose implementing a<br>
third mode that will scale the font based on the size of the viewport in<br>
which the prop is placed.<br>
<br>
As part of this changed, I would like to deprecate the Set/GetScaledText<br>
methods and replace them with a Set/GetTextScaleMode to capture the<br>
tri-scaling state.  Are there any objections?<br>
<br>
-Ken<br>
<br>
   ****      Kenneth Moreland<br>
    ***      Sandia National Laboratories<br>
***********<br>
*** *** ***  email: <a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a><br>
**  ***  **  phone: (505) 844-8919<br>
    ***      fax:   (505) 845-0833<br>
<br>
<br>
_______________________________________________<br>
vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br>
_______________________________________________<br>
vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>
<a href="http://www.kitware.com">http://www.kitware.com</a><br>518-371-3971 (phone and fax)