[Scilab-users] Changing the fontname for the content of a table uicontrol

Samuel Gougeon sgougeon at free.fr
Tue Aug 11 17:37:26 CEST 2020


Dear all,

I am struggling with changing the .fontname property for the content of 
a table uicontrol.
The default font is "Tahoma", that is not monospaced. I would like to 
set a monospaced font,
like "Monospaced", "Consolas", etc that are available on my system,
as reported by xlfont("AVAILABLE_FONTS").

xlfont("Consolas")  // works well:

--> xlfont
  ans  =
          column 1 to 7
*"Monospaced"*  "ScilabSymbols"  "Serif"  "Serif Italic"  "Serif Bold"  
"Serif Bold Italic"  "SansSerif"
          column 8 to 11
   "SansSerif Italic"  "SansSerif Bold"  "SansSerif Bold Italic"  
"SansSerif Bold Italic"

--> xlfont("Consolas");
--> xlfont
  ans  =
          column 1 to 7
*"Monospaced" *"ScilabSymbols"  "Serif"  "Serif Italic"  "Serif Bold"  
"Serif Bold Italic"  "SansSerif"
          column 8 to 12
   "SansSerif Italic"  "SansSerif Bold"  "SansSerif Bold Italic"  
"SansSerif Bold Italic" *"Consolas"*

But the, when i set it to the uicontrol, the rendering does not change:

xlfont()

table  =  [
   ""    "A"     "B"         "C"          "D"     
   "1"   "try"   "catch"     "abs"        "evstr"
   "2"   "do"    "members"   "while"      "sin"   
   "3"   "cos"   "isascii"   "linspace"   "tan"
   ];
f  =  gcf();  clf
as  =  f.axes_size;   // [width height]
ut  =  uicontrol("style","table",  "string",table,"FontName","Consolas",  ..
                "position", [5  as(2)-100  300  100]);  // =>@top left corner of figure

// 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.fontnameans ="Consolas"

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200811/a7cd8965/attachment.htm>


More information about the users mailing list