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

classic Classic list List threaded Threaded
2 messages Options
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

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

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.fontname
 ans  =
  "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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Changing the fontname for the content of a table uicontrol

OK: this issue has already been reported @ http://bugzilla.scilab.org/15612
It was already the same with Scilab 5.
Apparently, font* properties have not been implemented for tables.
This would deserve at least to be documented..

Samuel

Le 11/08/2020 à 17:37, Samuel Gougeon a écrit :

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.fontname
 ans  =
  "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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users