I just wanted to add my +1 to this issue as I spent all of last night and some of today trying to get this to work, as well.
A few other things I tried:
- Using an @import URL to an external font file resource hosted by Google Fonts. This is denied because of a CSP violation.
- Converting a font file to a data-URL, then trying to set up my own @font-face definition with it. This is also denied because of a CSP violation.
While it would be amazing to be able to read font files from the local vault, it seems that relaxing the Content Security Policy for fonts also gives us enough of a workaround to achieve what we need, in case loading files from the local file system is too difficult to do in the short term. (I suppose I don’t know what dangers there are in relaxing the CSP for fonts?)
One more thing that I wanted to say, to support something @vermillon said in their other post, the reason why I wanted to use font files in my vault and not install fonts system-wide is because I host my notes on my Dropbox, which are accessed by two different computers. I would like to be able to have the same styling whenever I move the vault itself around, rather than have to remember to install system fonts. This would also be great for theming because it means theme authors can bundle fonts into themes, rather than include separate installation instructions.
Thanks!