In this thread https://forum.xojo.com/15744-copy-canvas-to-imageview it appeared Picture.Graphics.Drawstring did not work for a Web Application once uploaded on a server, whereas it was working fine when run in the IDE.
The reason is that no fonts are installed on the said server. That is true for Xojo Cloud, as confirmed by Greg O’LOne in https://forum.xojo.com/15827-cdbasechartmbs-setfontsearchpath/0#p130614
That is true also for 1701 where my apps are hosted.
I tried to list fonts installed with this in the Shown event of a WebListBox and got no font :
For i As Integer = 0 To FontCount-1
me.addrow(Font(i))
Next
So I looked around the Internet and found two important pointers to help installing fonts :
http://www.ghacks.net/2009/01/09/installing-fonts-in-linux/
and
https://www.centos.org/forums/viewtopic.php?t=3028
I do not have permissions to /usr/share/fonts but was able to do the manipulation with the local fonts folder which should be quite enough for the needs of my apps :
Through SSH, to add the font metro.ttf :
mkdir ~/.fonts
mv metro.ttf ~/.fonts
Then as instructed on the second link, I ran
fc-cache -f -v
It looks as if fc was successful in recognizing the font :
/usr/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/X11/fonts/Type1: skipping, no such directory
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/home/bu1471a/.fonts: caching, new cache contents: 1 fonts, 0 dirs
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/bu1471a/.fontconfig: cleaning cache directory
fc-cache: succeeded
I verified the font has indeed been copied to the right place :
ls ~/.fonts
Metro.ttf
I checked X11 is installed by listing /usr/share/ and it is there. I will have to assume it runs. I cannot see it when I go ps though. Maybe I need to run it somehow ?
Everything seems OK, but yet, my app does not see the installed font. Has anybody bumped into that kind of difficulty ?