# Japanese Font Trouble

**URL:** <https://forums.ankiweb.net/t/japanese-font-trouble/44233>\
**Category:** Help\
**Created:** [April 30, 2024, 2:03pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233 "2024-04-30T14:03:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gigazol](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/gigazol/32/20632_2.png) [@gigazol](https://forums.ankiweb.net/u/gigazol)\
**Post date:** [April 30, 2024, 2:03pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/1 "2024-04-30T14:03:54Z")

</div>

Hi all. I’m using Anki for windows to learn Japanese. I’ve spent all morning trying to get the font right on the cards to no avail.

 ![Screenshot 2024-04-30 094833](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/0/d/0d641226b0a07459447a559e436fb0df407d0760.png)

Here, the English font is right (M PLUS 1), but the Japanese font is not. Also, you can see that the kanji characters appear to be a different weight than the hiragana characters, which is really what’s driving me nuts. I thought it was a copy/paste problem so I enabled the “paste without shift key strips formatting” option in editing preferences — no dice.

I’ve changed the editing font in every field to the right font, that didn’t fix it either. I’ve also tried several solutions from this forum (sorry, don’t know how to link). I’d just like these cards all in one font, with some things bolded. It’s fine if it’s a different font, but I can’t get Yu Mincho, for example, to work right either.

This is my front/back/styling code:

```auto
<div class="japanese" style="font-size:60px;">{{vocab-kanji}}</div>
<br/><div style="font-size: 16px; ">{{vocab-part}}</div>
<br/>< br/>
<div id="example-sentence" class="japanese" style="font-size:40px;">{{expression}}</div>

```

```auto
<div class="japanese" style="font-size: 50px; ">{{furigana:vocab-furigana}}</div>
<div style="font-size: 16px; ">{{vocab-part}}</div>
<br/>
<div style="font-size: 30px; ">{{vocab-english}}</div>
<br/>
<div class="japanese" style="font-size: 30px; ">{{furigana:reading}}</div>
<br/>
<div style="font-size: 20px; ">{{sentence-english}}</div>
<!---->

```

```auto
.card {
     font-family: "M PLUS 1" !; 
     font-size: 20px;
     text-align: center;
     color: black;
     background-color: white;
 }

```

(If I take away that “!” after M PLUS 1 it changes the English font to some default font. Don’t know why!)

Thanks for any help you can give and apologies for the long post!

---

<div class="post-metadata">

**Author:** ![sorata](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/sorata/32/34115_2.png) [@sorata](https://forums.ankiweb.net/u/sorata)\
**Post date:** [April 30, 2024, 2:06pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/2 "2024-04-30T14:06:02Z")

</div>

Did you try other fonts? I use KleeOne Regular.

---

<div class="post-metadata">

**Author:** ![gigazol](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/gigazol/32/20632_2.png) [@gigazol](https://forums.ankiweb.net/u/gigazol)\
**Post date:** [April 30, 2024, 6:39pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/3 "2024-04-30T18:39:11Z")

</div>

Yes — I tried Yu Mincho and Meiryo.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [April 30, 2024, 7:53pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/4 "2024-04-30T19:53:19Z")

</div>

> [@gigazol](#):
>
> I’ve changed the editing font in every field to the right font, that didn’t fix it either.

That **only** impacts the font you see in the Add/Edit note windows.

> [@gigazol](#):
>
> I thought it was a copy/paste problem so I enabled the “paste without shift key strips formatting” option in editing preferences — no dice.

Check the HTML view of the fields in the Editor by clicking the `< >` above the field – [Adding/Editing - Anki Manual](https://docs.ankiweb.net/editing.html#editing-features). You might still have some formatting in there that you don’t know about.

> [@gigazol](#):
>
> `<div class="japanese"`…

Where is your “japanese” class defined? Where are you applying the font that isn’t the primary/English font?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [May 2, 2024, 12:11pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/5 "2024-05-02T12:11:21Z")

</div>

You would also need something like this in your styling section:

```auto
.japanese { font-family: "some font"; }

```

---

<div class="post-metadata">

**Author:** ![gigazol](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/gigazol/32/20632_2.png) [@gigazol](https://forums.ankiweb.net/u/gigazol)\
**Post date:** [May 2, 2024, 6:24pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/6 "2024-05-02T18:24:29Z")

</div>

Okay, I think I solved it (somehow.) Thank you for your replies. In case someone else stumbles into this problem…

> [@Danika\_Dakika](#):
>
> Where is your “japanese” class defined? Where are you applying the font that isn’t the primary/English font?

I copied the initial formatting for the cards from a different deck, so they must have defined “japanese” somewhere. I removed that from my formatting to no effect. I replaced the code in my styling section with that from a different deck that WAS working with my desired font.

This is what I had:

```auto
.card {
    font-family: "M PLUS 1" !;
    font-size: 20px;
    text-align: center;
    color: black;
    background-color: white;
}

```

And this is what I replaced it with:

```auto
.card {
 font-family: "M PLUS 1";
 font-size: 25px;
 text-align: center;
 color: Black;
 background-color: White;
}

```

Shrug. It worked. So strange.

> [@Danika\_Dakika](#):
>
> That **only** impacts the font you see in the Add/Edit note windows.

Thank you — I didn’t realize that!

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [May 2, 2024, 7:20pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/7 "2024-05-02T19:20:39Z")

</div>

By removing the “japanese” class from those tags, you allowed them to fall back on the general “card” class that you have defined.

By removing the `!` on the font-family in the “card” class … 🤔 Well, it’s possible that’s an old version of `!important`, but I’m not totally sure. If it is, then removing it allowed text to use another font that was set at a closer level to the text – pasted into the field of your note, perhaps? [You can see that in the HTML view I mentioned earlier.]

But those changes won’t cause the font to remain consistent on other platforms. To do that, you’ll still need to install the font in your collection. [Styling & HTML - Anki Manual](https://docs.ankiweb.net/templates/styling.html#installing-fonts)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [June 1, 2024, 7:20pm UTC](https://forums.ankiweb.net/t/japanese-font-trouble/44233/8 "2024-06-01T19:20:53Z")

</div>

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