<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font face="Arial">Dear all,</font></p>
<p>I am struggling with changing the .fontname property for the
content of a table uicontrol.<br>
The default font is "Tahoma", that is not monospaced. I would like
to set a monospaced font,<br>
like "Monospaced", "Consolas", etc that are available on my
system,<br>
as reported by xlfont("AVAILABLE_FONTS").</p>
<p><tt>xlfont("Consolas")Â // works well:</tt></p>
<p><tt>--> xlfont</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â column 1 to 7</tt><tt><br>
</tt><tt>Â <b>"Monospaced"</b>Â "ScilabSymbols"Â "Serif"Â "Serif
Italic"Â "Serif Bold"Â "Serif Bold Italic"Â "SansSerif"</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â column 8 to 11</tt><tt><br>
</tt><tt>Â "SansSerif Italic"Â "SansSerif Bold"Â "SansSerif Bold
Italic"Â "SansSerif Bold Italic"</tt><tt><br>
</tt><tt><br>
</tt><tt>--> xlfont("Consolas");</tt><tt><br>
</tt><tt>--> xlfont</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â column 1 to 7</tt><tt><br>
</tt><tt>Â </tt><tt><b>"Monospaced"Â </b></tt><tt>
"ScilabSymbols"Â "Serif"Â "Serif Italic"Â "Serif Bold"Â "Serif
Bold Italic"Â "SansSerif"</tt><tt><br>
</tt><tt>Â Â Â Â Â Â Â Â column 8 to 12</tt><tt><br>
</tt><tt>Â "SansSerif Italic"Â "SansSerif Bold"Â "SansSerif Bold
Italic"Â "SansSerif Bold Italic"Â <b>"Consolas"</b></tt><br>
</p>
<p>But the, when i set it to the uicontrol, the rendering does not
change:<br>
</p>
<p>xlfont()<br>
<br>
</p>
<pre style="font-family:Monospaced;font-style:normal;font-size:15.0;"><span style="color:rgb(0,0,0);">table</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">A</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">B</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">C</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">D</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">try</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">catch</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">abs</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">evstr</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">do</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">members</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">while</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">sin</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">3</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">cos</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">isascii</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">linspace</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">tan</span><span style="color:rgb(188,143,143);">"</span>
<span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">f</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">gcf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(0,0,0);">clf</span>
<span style="color:rgb(0,0,0);">as</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">f</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">axes_size</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// [width height]</span>
<span style="color:rgb(0,0,0);">ut</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">uicontrol</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">style</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">table</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">string</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);"> table</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(255,170,0);"></span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">FontName</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">Consolas</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(255,170,0);">..</span>
<span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">position</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">5</span> <span style="color:rgb(0,0,0);">as</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">-</span><span style="color:rgb(188,143,143);">100</span> <span style="color:rgb(188,143,143);">300</span> <span style="color:rgb(188,143,143);">100</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// =</span><span style="color:rgb(100,174,100);font-style:italic;">></span><span style="color:rgb(100,174,100);font-style:italic;"> @top left corner of figure
</span><pre style="font-family:Monospaced;font-style:normal;font-size:15.0;"><tt>// No change in the display, even after resizing a bit the figure (sometimes required to update the display).
Yet, the property has well been assigned:
--> ut.fontname</tt><tt>
</tt><tt> ans =</tt><tt>
</tt><tt> "Consolas"</tt>
Does anyone experiment the same, or succeed by doing it in another way?
Using "<html><p style=""font-family:Consolas">...</p>" in each cell works,
but is so unhandy while a property is theoretically available to do the job...
Thanks
Samuel
</pre>
<span style="color:rgb(100,174,100);font-style:italic;"></span></pre>
</body>
</html>