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

Why are all alternate fonts not working ?

1410725998
Dan W.
Sheet Author
Okay, struggling like mad to get the work I've poured into my sheet to actually work right ... Starting with fonts... I've got this at the top of my css: @font-face { font-style:normal; font-weight:400; src:local('Nova Cut Book'), local('NovaCutBook-Regular'),url(<a href="http://openfontlibrary.org/assets/fonts/nova/9fea9bf34ffdc4d4c44a8502d0deb44b/705bea8a3de102e01c88119e1e36fa4e/NovaCutBook.ttf" rel="nofollow">http://openfontlibrary.org/assets/fonts/nova/9fea9bf34ffdc4d4c44a8502d0deb44b/705bea8a3de102e01c88119e1e36fa4e/NovaCutBook.ttf</a>) format('truetype'); } .charsheet .sheet-outer-div { vertical-align:top; width:100%; font-family:'Nova Cut Book'; max-width: 832px; } But, nothing happens. I just get the default font. I looked at other contributed sheets to compare what I was doing, but they all display the same problem from what I can tell. I looked specifically at Runequest and Star Frontiers plus one or two others. None of them seem to successfully use alternative fonts either. But, they ARE there in the source of the page. This works perfectly fine when I display the text in either a jsfiddle or loaded as a file:// on my laptop... I don't get it. Has *anybody* gotten this to work? Is this a known problem, or is this a security 'feature' ?
No promises that the Star Frontiers font code was working. I tried using the same code as the Runequest sheet (which did work on my computer) to do the code for SF, but I never got it to work. I read somewhere that it could be a problem with Firefox not rendering the font?
1411398068
Tom
Pro
Sheet Author
Having the exact same issue with my Witch Hunter sheet. Older Safari works, but not Firefox or Chrome.
1411400518

Edited 1411400715
Kevin the Barbarian
Pro
Sheet Author
API Scripter
Maybe this could be the problem? Also, I submitted a pull request removing your font import for the SF sheet but I didn't see this thread. I just assumed it wasn't supposed to work. Web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction. From <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face</a>
1411414584
Dan W.
Sheet Author
@Kevin, I don't think so. That is the same-origin policy restriction that exists to keep script from site 1 accessing resources and data from site 2 and preventing cross-site scripting attacks. At least, that's how I understand it. All my fonts work fine on my machine without a problem. The fonts of other sheets don't seem to work no matter where they are imported from *unless* they are referenced as locally available resources. See Brian's Dresden Files RPG submission for an example of that using Lucida Handwriting. I'm not sure how he got that to work as it's not accessing a font via the web so the font must be local somehow, yet it's not in my system and I don't see it in the resources when looking at the page source. @Tom, yes, I saw that. I'm sorry for trying to 'help' you in the other thread -- I realized later that I was spouting nonsense and general unhelpful drek after I experienced the problem myself. I gave up on this to fix multitudes of other problems I was having and I'll revisit it later.
1411415024
Kevin the Barbarian
Pro
Sheet Author
API Scripter
Yeah, that is the same-origin policy. I believe fonts are treated the same as scripts since they could potentially be abused. I could be wrong though! So, is anyone (@Chris W?) actively working on the Star Frontiers sheet? I was going to move it away from a table-based layout and do some UI improvements (selects instead of inputs etc), add some rolls and all that but don't want to step on anyone else's work and I also don't want to devote time to it if someone else is already improving it.
@Kevin: I'm not doing anything with it, feel free to clean it up/ improve it.