<div dir="ltr"><div><div><div><div>I am trying to add axes to a window and have an issue to change font size of axis test. The partial code is as following:<br><br>    cube = vtkSmartPointer&lt;vtkAnnotatedCubeActor&gt;::New();<br>
    cube-&gt;SetXPlusFaceText(&quot;R&quot;);<br>    cube-&gt;SetXMinusFaceText(&quot;L&quot;);<br>    cube-&gt;SetYPlusFaceText(&quot;A&quot;);<br>    cube-&gt;SetYMinusFaceText(&quot;P&quot;);<br>    cube-&gt;SetZPlusFaceText(&quot;I&quot;);<br>
    cube-&gt;SetZMinusFaceText(&quot;S&quot;);<br>    cube-&gt;SetXFaceTextRotation(180);<br>    cube-&gt;SetYFaceTextRotation(180);<br>    cube-&gt;SetZFaceTextRotation(-90);<br>    cube-&gt;SetFaceTextScale(0.65);<br><br>
    vtkSmartPointer&lt;vtkProperty&gt; cube_property = cube-&gt;GetCubeProperty();<br>    cube_property-&gt;SetColor(0.5, 1, 1);<br><br>    cube_property = cube-&gt;GetTextEdgesProperty();<br>    cube_property-&gt;SetLineWidth(1);<br>
    cube_property-&gt;SetDiffuse(0);<br>    cube_property-&gt;SetAmbient(1);<br>    cube_property-&gt;SetColor(0.18, 0.28, 0.23);<br><br>    cube_property = cube-&gt;GetXPlusFaceProperty();<br>    cube_property-&gt;SetColor(0,0,1);<br>
    cube_property-&gt;SetInterpolationToFlat();<br><br>    cube_property = cube-&gt;GetXMinusFaceProperty();<br>    cube_property-&gt;SetColor(0,0,1);<br>    cube_property-&gt;SetInterpolationToFlat();<br><br>    cube_property = cube-&gt;GetYPlusFaceProperty();<br>
    cube_property-&gt;SetColor(0,1,0);<br>    cube_property-&gt;SetInterpolationToFlat();<br><br>    cube_property = cube-&gt;GetYMinusFaceProperty();<br>    cube_property-&gt;SetColor(0,1,0);<br>    cube_property-&gt;SetInterpolationToFlat();<br>
<br>    cube_property = cube-&gt;GetZPlusFaceProperty();<br>    cube_property-&gt;SetColor(1,0,0);<br>    cube_property-&gt;SetInterpolationToFlat();<br><br>    cube_property = cube-&gt;GetZMinusFaceProperty();<br>    cube_property-&gt;SetColor(1,0,0);<br>
    cube_property-&gt;SetInterpolationToFlat();<br><br>    axes = vtkSmartPointer&lt;vtkAxesActor&gt;::New();<br>    axes-&gt;SetShaftTypeToCylinder();<br>    axes-&gt;SetXAxisLabelText(&quot;x&quot;);<br>    axes-&gt;SetYAxisLabelText(&quot;y&quot;);<br>
    axes-&gt;SetZAxisLabelText(&quot;z&quot;);<br>    axes-&gt;SetTotalLength(1.5, 1.5, 1.5);<br><br>    vtkSmartPointer&lt;vtkTextProperty&gt; tprop = vtkSmartPointer&lt;vtkTextProperty&gt;::New();<br>    tprop-&gt;ItalicOn();<br>
    tprop-&gt;ShadowOn();<br>    tprop-&gt;SetFontFamilyToTimes();<br>    std::cout &lt;&lt; tprop-&gt;GetFontSize();<br>    tprop-&gt;SetFontSize(18);<br>    axes-&gt;GetXAxisCaptionActor2D()-&gt;SetCaptionTextProperty(tprop);<br>
<br>    vtkSmartPointer&lt;vtkTextProperty&gt; tprop2 = vtkSmartPointer&lt;vtkTextProperty&gt;::New();<br>    tprop2-&gt;ShallowCopy(tprop);<br>    axes-&gt;GetYAxisCaptionActor2D()-&gt;SetCaptionTextProperty(tprop2);<br>
<br>    vtkSmartPointer&lt;vtkTextProperty&gt; tprop3 = vtkSmartPointer&lt;vtkTextProperty&gt;::New();<br>    tprop3-&gt;ShallowCopy(tprop);<br>    axes-&gt;GetZAxisCaptionActor2D()-&gt;SetCaptionTextProperty(tprop3);<br>
<br>    assembly = vtkSmartPointer&lt;vtkPropAssembly&gt;::New();<br>    assembly-&gt;AddPart(axes);<br>    assembly-&gt;AddPart(cube);<br><br>    marker = vtkSmartPointer&lt;vtkOrientationMarkerWidget&gt;::New();<br>    marker-&gt;SetOutlineColor(0.93, 0.57, 0.13);<br>
    marker-&gt;SetOrientationMarker(assembly);<br><br>    iact = renWinImage-&gt;GetInteractor();<br>    iact_style = vtkSmartPointer&lt;vtkInteractorStyleTrackballCamera&gt;::New();<br>    iact-&gt;SetInteractorStyle(iact_style);<br>
<br>    marker-&gt;SetInteractor(iact);<br>    marker-&gt;SetEnabled(1);<br>    marker-&gt;InteractiveOff();<br><br>    renWinImage-&gt;Render();<br><br></div>The font of axes text X, Y and Z looks small. I tried to set up larger font size ( tprop-&gt;SetFontSize(18);) and it seems not working. The &quot;std::cout &lt;&lt; tprop-&gt;GetFontSize();&quot; does not print out the size when the program is started. It shows default size &quot;12&quot; when I close the program. My questions are:<br>
</div>(1) is SetFontSize() the right method to change the font size?<br></div>(2) if it is the right function to use, what I should pay attention to make it effective?<br><br></div>Thanks ahead for any help.<br><div><div>
<div><div><br></div></div></div></div></div>