Custom Font AnkiDroid

.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
@font-face {
font-family: myfont;
src: url(“_cmunrm.ttf”);
}
.cloze {
font-weight: bold;
color: red;
}
.nightMode .cloze {
color: red;
}

So this is my code. I’ve followed the instructions in the manual best to my understanding, but it doesn’t work. I’ve tried removing the line ‘font-family: arial;’ but that doesn’t do it either.

The output is below:

Change ‘arial’ to ‘myfont’

1 Like

Still doesn’t work. It looks like it’s still in Arial:

What exactly does the font family represent? If it corresponds to a folder or something, I have not done anything regarding that.

(Also, this is how the font I’m trying to get looks like, just for assurance’s sake: )

Not sure if it is relevant here, but I think the “custom fonts” feature may have been removed in AnkiDroid 2.1.17: AnkiDroid 2.1.17 - Removed Features.

I think that’s the different Droid-specific way that was removed. They’ve kept the standard method cross-platform method – AnkiDroid 2.17 User Manual.

1 Like

Seems to work for me, after I correct the double quote characters that the forum presumably changed. If it doesn’t work on AnkiDroid 2.17, please report the issue on the AnkiDroid issue tracker.

I’m sorry, I did not understand that. What double characters? I presume that is not a problem on my side in the original code as you’re saying the forum did something?

Hmm, my app shows it’s version 2.16.5, and it seems to be the latest available one on playstore. Do I wait for the next update or…?

AnkiDroid 2.17+ is rolling out now, so it may not have reached you yet. If you want to get it sooner, you can join the beta tester program (AnkiDroid 2.17 User Manual). There isn’t a beta version out now, so that should just bring you forward to 2.17+ (and you can leave the beta program after that, if you like).

1 Like

The quotes in your top post are “smart” quotes instead of the "plain" quotes that Anki expects. Please ensure you see the latter in your card template.

Oh, I see. But no change after fixing it, the custom font is still not showing up. I guess I’ll try again in the next update.
Thanks for your help!

Are you wrapping the content (words or line or …) that you want in your custom font in a or other tag?

I have several publicly available decks that use custom fonts, some extensively, and they are all working fine. If it will help, download my Vocabulary from Elements of New Testament Greek, 3rd edition and look at the cards. You will see that I wrap the paragraph, in which I want a specific Greek font to be used, in

tags. The greek class is then defined on the Styling tab of the Card Type (“.greek”) to use the specific font.

If you would like a different example, in which lots of specific fonts used (using mostly the tag), then look at my Byzantine Music group of decks.

It might be easier for you to see a working example.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.