Load a font from file
Load a font from file
In PB we have the nice "RegisterFontFile()" command to provide our own font. Does anybody know how this can be achieved in SpiderBasic?
-
- Posts: 220
- Joined: Sat Mar 01, 2014 3:02 pm
Re: Load a font from file
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:
...and then in SB:
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);
}
Code: Select all
OpenLibrary("/css/test.css")
LoadFont(0,"FontNotAwesome",12)
Re: Load a font from file
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!
And of course thanks to RSBasic for this cool procedure, I will use it a lot!