Add the ttf of the font you want into ~/.local/share/Anki2/User 1/collection.media
.
Rename it so it has the underscore before the name (this ensures "check empty media" doesn't delete it).
Put this in the CSS of the note where you want to use this font:
@font-face {
font-family: InputMonoGrafted;
src: url("_InputMono-Regular.ttf");
}
It should be at the bottom; apparently as the absolute last thing in your CSS.
InputMonoGrafted
is your own name for the font, which is how you're gonna refer to it.
In the url
, specify the path, relative to collection.media
.
Now you can sync from the computer, then sync from the phone, and you'll see phone use the correct font now.
To add multiple custom fonts, just add a @font-face
block per each of them.
I tried adding _Inter_28pt-Regular.ttf
, but it didn't work, probably because 28 is too big; worked with 18 though. So that may be a factor.