trouble setting default font

171 views
Skip to first unread message

fergal

unread,
Dec 25, 2011, 10:57:36 AM12/25/11
to AnkiDroid
Hi,

I'm trying to set the default font to DroidSansJapanese.ttf. I'm
running AnkiDroid v1.0 on a Nexus S with Ice Cream Sandwich.

I've tried with DroidSansJapanese.ttf and "Droid Sans Japanese.ttf",
in /sdcard/fonts and /sdcards/AnkiDroid . All of these left me with
just "System default" in the menu for default font.

Which is the correct file name and directory? The AnkiDroid directory
didn't exist before now, my decks appear to live in /sdcard. Thanks,

F

fergal

unread,
Dec 27, 2011, 9:29:01 AM12/27/11
to AnkiDroid
By clearing all user data and syncing my decks again, I was able to
get AnkiDroid to see my .ttf file.

I still can't get it to use it to display Japanese instead of Chinese,

F

tsukaima

unread,
Jan 2, 2012, 5:04:41 PM1/2/12
to anki-a...@googlegroups.com
Having the same problem myself. I'm using MIUI which is a Chinese-based Android (in English translation)... The default fonts therefore are Chinese rather than Japanese, which I'm not sure if makes a difference or not. However, due to the style of the default font, it's hard to read anyway. I want to use DroidSansJapanese.ttf instead. It shows up on the font list, however it does not actually USE the font on the cards. It still uses the system font. The font selection in settings appears to be merely for decoration of the settings menu.

Flavio

unread,
Jan 3, 2012, 3:51:12 AM1/3/12
to anki-a...@googlegroups.com
Dear Fergal and Tsukaima:

First of all, the font must be located in a fonts subdirectory of the AnkiDroid directory on the SD card.
  For example: /sdcards/AnkiDroid/fonts
If the font name does not appear in the list of fonts together with the "System default" under the setting "Other -> Default font", they will not work on cards.

The "Default font" in the settings is only applied to unformatted text, i.e., text in your template that is either:
- not part of a field; or
- fields included without formatting.

Let's consider the following card template example:

Front:
What is the capital of {{Country}}?

Back:
{{{Capital}}}

In this case:
- "What is the capital of" and "?" are not part of a field and they will be formatted using the default font.
- The capital name on the back will be formatted using the default font.

However, the country name will be formatted using the font as it is specified in the field definition.

If the card template looks like:

Front:
{{Country}}

Back:
{{Capital}}

Then the default font is never used. Instead the font defined for the two fields is used.

You cannot currently change the font of a field in AnkiDroid, but you can do so by looking at "Settings -> Deck Properties," editing the model used by your cards, opening the "Card Layout" and looking under the "Fields" in Anki on the desktop. The "Font" field contains the name of the font used by the field.
Let's assume that the font name is "Arial" there: if you upload a file named "Arial.ttf," it should be used for that field.

Note that you need to make sure that the name of the file matches the name of the font as defined in the field definition: this includes any spaces or special characters.

I hope this helps!
-Flavio

PS:
I will update the content of:
to reflect this and hopefully make it clearer.

iniju

unread,
Jan 4, 2012, 5:10:16 AM1/4/12
to AnkiDroid
Just wanted to add to Flavio's explanation that I had problem making
the font specific for a field work with the market version, but it
worked for me after I installed the latest dev version.
It could be that it just needed a clear app data operation which was
done by installing that new version.

I think it's worth adjusting the description for the Default Font
preference option to specify that it only works for fields with no
font formatting.

Cheers,
Kostas

Nicolas Raoul

unread,
Jan 4, 2012, 5:16:03 AM1/4/12
to anki-a...@googlegroups.com
I updated the description:
https://github.com/nicolas-raoul/Anki-Android/commit/7ae4d89d48ae223342ca4fd2ad6aded0708848f3

Cheers!
Nicolas Raoul

> --
> You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
> To post to this group, send an email to anki-a...@googlegroups.com.
> To unsubscribe from this group, send email to anki-android...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/anki-android?hl=en-GB.
>

Reply all
Reply to author
Forward
0 new messages