Hi all!
Obsidian newbie here
I’m trying to make Obsidian display text in a specific font whose file I have stored in my vault. I’ve managed to use obsidian.css to change the size of the font or load a pre-installed font, but not the font I need. I’ve tried a few things:
The font file is placed in my vault, next to obsidian.css
I’ve defined a CSS class and a @font-face as follows:
@font-face {
font-family: CuneiformOB;
src: url('CuneiformOB.ttf');
}
which gets me:
GET app://obsidian.md/CuneiformOB.ttf net::ERR_FILE_NOT_FOUND
I have also tried:
@font-face {
font-family: CuneiformOB;
src: url('file:///home/...../obsidian/CuneiformOB.ttf');
}
which gives
app.js:1 Not allowed to load local resource: file:///home/.../CuneiformOB.ttf
I have then tried serving it from a local server:
@font-face {
font-family: CuneiformOB;
src: url('http://0.0.0.0:8000/CuneiformOB.ttf');
}
but that gives:
Refused to load the font 'http://0.0.0.0:8000/CuneiformOB.ttf' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback.
Finally, if I remove url() and keep either CuneiformOB.ttf or file:///…/CuneiformOB.ttf , no error but no font applied either…
I guess the main problem is that I don’t know where to put the font for app://obsidian.md/CuneiformOB.ttf to resolve. My question is therefore: where should I store the font (it’s not a system-wide font) and how should I specify/register it?
Or is this a feature request?