Just starting out? Need help? Post your questions and find answers here.
munfraid
 
Posts: 29
Joined: Sat Mar 24, 2018 1:33 pm

Load a font from file

by munfraid Fri Jun 21, 2019 10:41 am

In PB we have the nice "RegisterFontFile()" command to provide our own font. Does anybody know how this can be achieved in SpiderBasic?
the.weavster
 
Posts: 162
Joined: Sat Mar 01, 2014 3:02 pm

Re: Load a font from file

by the.weavster Sun Jun 23, 2019 3:19 pm

I haven't tested this but RSBasic has made an OpenLibrary() command that enables you to load your own css file.

Maybe you could create a test.css file containing something like this:
Code: Select all
@font-face {
  font-family: FontNotAwesome;
  src: url(font_file.otf);
}

...and then in SB:
Code: Select all
OpenLibrary("/css/test.css")
LoadFont(0,"FontNotAwesome",12)
munfraid
 
Posts: 29
Joined: Sat Mar 24, 2018 1:33 pm

Re: Load a font from file

by munfraid Mon Jun 24, 2019 9:53 am

Just tried it and it works perfectly - thanks a lot, the.weavster! :)
And of course thanks to RSBasic for this cool procedure, I will use it a lot!
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 3 guests