Hello everybody,
I'm building my project using Sugarcube2 and compiling it with Tweego and I'm having problems loading a custom font from a folder in it. Currently, my project has this structure:
-SHR
--SHR_media
---Minecraft.woff <--The font I want to use
---(some other files)
--src
---StoryCss.tw <--The file where I have the ::StoyCSS [stylesheet] passage
---(some other files)
--shr.html <--The resulting html file when compiling the project
In the StoryCss.tw file, I'm declaring the font and using it like this:
@font-face {
font-family: Minecraft;
src: url(/SHR_media/Minecraft.woff);
}
#invitation-email p {
color: black;
font-family: Minecraft;
text-align: center;
}
Finally, on the game passage, the css is loaded correctly for the <p> elements in a <div> with the #invitation-email id (it appears black and centered) but the font doesn't load. It changes from the default Sugarcube font to another one that is not Minecraft.woff (I supose it's another default font for when no font is found).
I've tried declaring the url sentence in the font declaration in different ways...
src: url(SHR_media/Minecraft.ttf);
src: url(/SHR_media/Minecraft.ttf);
src: url(./SHR_media/Minecraft.ttf);
src: url(../SHR_media/Minecraft.ttf);
...since I've seen that path should be relative to the .css file on a common website, but I'm not sure from what it should be relative in a Sugarcube2+Tweego project (from the file where the css passage is located or from the .html file you open the game?) so I've tried all options, but no one works.
Anybody knows how to fix it? Thanks!