Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] using external @font-face in API

1409004649

Edited 1409004749
DXWarlock
Sheet Author
API Scripter
Maybe one of the css and API wizs here know how to do this. Im trying to reference an external font for my &lt;div&gt; direct chat sends. But since you cannot do proper stylesheet code in API (or I cannot find a way) I cant work out how to do this. For the example to call an external font you need: @font-face { font-family: SomeFont; src: url(<a href="http://thatsite.com/Thisfont.woff" rel="nofollow">http://thatsite.com/Thisfont.woff</a>); } and then do such as: &lt;div style='font-family: SomeFont; font-size: 9pt;(......) Is there a way to do the @font-face with inline css so API takes it. Or a way to define the above within the API so it works correctly?
Try using: &lt;style scoped&gt; /* your @font-face and other CSS rules go here */ &lt;/style&gt;
1409006328
Lithl
Pro
Sheet Author
API Scripter
Please post the actual font-family name you're using and the actual URL to the woff.
1409007296

Edited 1409007448
DXWarlock
Sheet Author
API Scripter
I tried that badger but couldn't get the API to save and read it without a generic error when it called it (I was declaring it as a variable and calling it in the div, that might be the wrong way) The name Im using is " Dust " url is: <a href="http://alttabgamers.com/dust.woff" rel="nofollow">http://alttabgamers.com/dust.woff</a>
1409013963

Edited 1409027653
Lithl
Pro
Sheet Author
API Scripter
I'd have to double-check, but "alt" may be one of the strings that cause the CSS to fail the security check. If you can get an alternate url to the resource, try that. Edit: The above is incorrect. The strings which cause the sanitizer to throw out the CSS are: data: eval cookie window parent this behavior behaviour expression moz-binding @import @charset javascript vbscript script