How to Add Custom Fonts to Anki

↑ Back to Top
Anki Help

How to Add Custom Fonts to Anki

Anki can use a font file stored directly in your collection, so your cards can display a custom Chinese font without relying on that font being installed system-wide. This tutorial also creates a separate note type for the custom font, which helps keep your existing cards and note types unchanged.

View Anki's official custom-font instructions →

Rename the font file for Anki

Open your Downloads folder, or the folder where you saved the font. Right-click the font file and choose Rename.

Add an underscore (_) to the very beginning of the filename. For example, WCL-05.ttf becomes _WCL-05.ttf. Keep the existing file extension exactly as it is.

Why the underscore? Anki uses it to recognize the font as a file referenced by a card template, so it will not be treated as unused media during media checks.

Downloads folder with a downloaded font selected and the Rename command highlighted.
Click the image to view it at full size.

Move the font into collection.media

Open your Anki profile's collection.media folder. Drag the renamed font file from Downloads into collection.media. If you saved the font somewhere else, move it from that folder instead.

Two Finder windows showing a font being moved from Downloads into Anki's collection.media folder.
Click the image to view it at full size.

Can't find collection.media?

Mac: In Finder, open Go while holding Option, choose Library, then open Application Support/Anki2/your profile/collection.media.

Windows: Enter %APPDATA%\Anki2 in File Explorer's address bar, then open your profile folder and collection.media.

Linux: Recent Anki versions normally store profile data under ~/.local/share/Anki2.

Prefer a visual walkthrough? Watch this short video showing how to find your collection.media folder →

Anki keeps a separate collection.media folder inside each profile, so be sure you are using the profile that contains the cards you want to style. See Anki's official file-location guide →

Confirm the font is in the media folder

Check that the renamed font now appears inside collection.media. Make a note of the filename because you will need to enter it exactly in Anki later.

For this method, you do not need to install the font separately in Font Book or Windows Fonts. Anki will load the font from its media folder.

Anki collection.media folder showing the renamed custom font file inside it.
Click the image to view it at full size.

Open the Add window in Anki

Open Anki and click Add at the top of the main window. The Add window will open.

You will use this window to create and select a note type that uses your custom font.

Anki main window and Add window with the Add button indicated.
Click the image to view it at full size.

Open the note type selector

In the Add window, click the current note type next to Type. In the example, the current note type is Basic.

The Choose Note Type window will open.

Anki Add window showing the current note type and the Choose Note Type window.
Click the image to view it at full size.

Open Manage Note Types

In the Choose Note Type window, click Manage. The Note Types window will open.

Why create a new note type? It gives you a separate version for the custom font instead of changing the styling of your existing Basic note type and every card that already uses it.

Anki Choose Note Type window with Manage selected and the Note Types window open.
Click the image to view it at full size.

Create a new note type

In the Note Types window, click Add.

In the Add Note Type window, choose the note type you want to use as the starting point, then click OK.

The example uses Basic, which is a simple choice for standard front-and-back cards. If you normally use a different note type, choose the one that matches the kind of cards you plan to create.

Anki Note Types and Add Note Type windows showing Basic selected as the starting note type.
Click the image to view it at full size.

Name the new note type

Enter a clear name for the new note type. In this example, it is called Chinese Font. Click OK to save it.

Then close the Note Types and Choose Note Type windows to return to the Add window.

Anki dialog for naming a new note type, with Chinese Font entered as the example name.
Click the image to view it at full size.

Select your new note type

Back in the Add window, click the current note type next to Type again. When the Choose Note Type window opens, select the note type you just created and click Choose.

In the example, the new note type is Chinese Font.

Anki Choose Note Type window showing the newly created Chinese Font note type selected.
Click the image to view it at full size.

Add the custom font to the card styling

With your new note type selected in the Add window, click Cards... to open the Card Types window. Then click Styling.

In the existing .card section, find the font-family: line and change its value to myfont. For example, change font-family: arial; to font-family: myfont;. You can also change the font-size value if you want larger or smaller text.

Next, go to the bottom of the existing styling code, after the final closing brace, and paste the code from the Custom font CSS box shown beside the instructions.

Important: The filename in url("...") must match the real file exactly, including the underscore, capitalization, punctuation, and file extension.

Anki Card Types window showing the Styling section, the font-family setting, and custom font-face CSS.
Click the image to view it at full size.
Custom font CSS
@font-face {
  font-family: myfont;
  src: url("_YOUR-FONT-FILE.ttf");
}

Replace _YOUR-FONT-FILE.ttf with the exact filename in your collection.media folder. If your file is _WCL-05.ttf, use that exact name. If your font uses another supported extension, such as .otf, keep that extension instead.

Check that the new font is working

The preview in the Card Types window should now display text in your custom font. Cards created with this note type will use the same styling.

Close the Card Types window when you are finished. You can now add cards with your custom-font note type selected.

Anki Card Types preview showing text displayed with the newly added custom font.
Click the image to view it at full size.

If the font does not appear

  • Make sure the font file is inside the collection.media folder for the Anki profile you are actually using.
  • Check that the filename begins with an underscore, such as _MyFont.ttf.
  • Make sure the filename in the CSS matches the real filename exactly, including uppercase and lowercase letters and the extension.
  • Confirm that the .card section says font-family: myfont; and that the @font-face block is below the existing CSS.
Scroll to Top