Re: [Ankidroid] Font problems, custom font won't show. [Ankidroid 2.0 Beta 19]

3,087 views
Skip to first unread message

Flavio Lerda

unread,
Oct 21, 2012, 9:43:11 AM10/21/12
to anki-a...@googlegroups.com
Hello,

Custom fonts support should work, as I used it everyday.
But there are a number of subtle ways to get this wrong.
If you send me your deck and the font files, I can try to fix it for you.

Also, which version of Android are you using on your device?

-Flavio

On Sun, Oct 21, 2012 at 1:31 PM, <ruediger....@googlemail.com> wrote:

My custom fonts won't show in Ankidroid. I did everything as in the manual & rebooted my phone (SGS i9000).
So here is what I did:

Method 1:
  • named file HDZB_75.TTF to _hdzb.ttf
  • placed it to ../Anki/<username>/collection.media
  • changed style in template
  • applied <span>-style to my template

Method 2:

  • hdzB_75.TTF installed on computer
  • got name of font via field-menu in Anki-Desktop (汉鼎繁中楷) renamed file to 汉鼎繁中楷.tts
  • moved file to my phone ../sdcard/AnkiDriod/fonts/
  • did same as above with templates


That's my custom Stylsheet:

@font-face { font-family: cn_vereinfacht; src: url('hdzb.ttf'); }

.card {

     font-size: 5rem;

     text-align: center;

     color: black;

     background-color: white;

}

.schriftzeichen {

     font-family: cn_vereinfacht;

}

.schriftzeichen2 {

     font-family: 汉鼎繁中楷;

}


Frontside:

{{Deutsch}}

<span class="schriftzeichen">我</span>

<span class="schriftzeichen2">我</span>


Backside:

{{Schriftzeichen}}

<span class="schriftzeichen">我</span>

<span class="schriftzeichen2">我</span>


In Ankidroid it just shows all in default font, while in Anki-Desktop only method 2 worked.


Did I do something wrong or are custom fonts not fully implemented yet?



--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/anki-android/-/k6KtZKERVSQJ.
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.



--
Flavio Lerda

Damien Elmes

unread,
Oct 21, 2012, 9:52:04 AM10/21/12
to anki-a...@googlegroups.com

Flavio Lerda

unread,
Oct 21, 2012, 9:59:51 AM10/21/12
to anki-a...@googlegroups.com
Yes, the support for custom fonts on AnkiDroid is not the same as the one in Anki 2 (as it predates it).
If in the future we were to support the Anki 2 way, than things would probably work out of the box.
It is still possible to have custom fonts on AnkiDroid, but the procedure is slightly different at the moment.

-Flavio
--
Flavio Lerda

-=RelakS=-

unread,
Jan 20, 2013, 5:14:17 AM1/20/13
to anki-a...@googlegroups.com
Oh, hi.

I am using custom fonts for my decks. In AnkiDroid 1 it was all good.

Now I updated to Ankidroid V2.0, aaanddd....
In my Japanese deck I'm using HGSKyokashotai font. After I extracted it from the TTC file and added to the AnkiDroid/fonts folder, it was all good, and after the upgrade, still works well.
In my English deck, I'm using DejaVu Sans Condensed font for the pronunciation. In Anki1 the DejaVu Sans Condensed.ttf worked well, but in Anki2 it does not show. It may be related to the spaces in the font name.

Is there any workaround, what not includes tampering with the font file?

I know this thread started with the beta, but I did not want to open a new one with the same topic.

Houssam Salem

unread,
Jan 20, 2013, 5:41:07 AM1/20/13
to anki-a...@googlegroups.com
It's likely a breaking change in the template after upgrading. Please try the new approach to custom fonts in Anki 2 as described in the manual and see how that goes. The advantage to this is that you can sync your fonts as well, making it much easier to work with custom fonts across platforms.

-=RelakS=-

unread,
Jan 20, 2013, 6:23:47 AM1/20/13
to anki-a...@googlegroups.com
Thank you!

This solved the problem.

kapst...@gmail.com

unread,
Oct 12, 2013, 12:09:41 AM10/12/13
to anki-a...@googlegroups.com, ruediger....@googlemail.com
Hello. I am having trouble with installing a custom font ("Wwin_BurmeseBold1") on my Samsung Galaxy SIII. I read the thread here an do not understand what I must do. Thank you for any advice.

Flavio Lerda

unread,
Oct 12, 2013, 1:21:34 PM10/12/13
to anki-a...@googlegroups.com, ruediger....@googlemail.com
​Please follow the instructions at:
The instructions have been updated since this thread was first started.

This should tell you what needs to be done​.

If it still does not work, please post the details of what you have done in detail,
including the content of the styling section and the list of files in the media directory.

Thanks,
Flavio



--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jud...@gmail.com

unread,
Nov 26, 2013, 8:53:19 PM11/26/13
to anki-a...@googlegroups.com, ruediger....@googlemail.com
Newbie here. I'm trying to get the SBL Greek font to show up on AD, but it seems to just show the default system font. This is what my style has:

.card {

font-family: sblgrk;

font-size: 20px;

text-align: center;

color: black;

background-color: white;

}


@font-face { font-family: "sblgrk"; src: url("_SBL_grk.ttf"); }


I've copied the _SBL_grk.ttf to the proper folder, and it downloaded to AD, but for whatever reason it will not display the proper font.


Thanks for any help!

Flavio Lerda

unread,
Nov 27, 2013, 8:09:31 AM11/27/13
to anki-a...@googlegroups.com
Does the file in the local file system on the device?
It should be under AnkiDroid/collection.media/_SBL_grk.ttf
Not sure if putting @font-face after using the actual font-family could also cause an issue, but worth trying.

Flavio

Eric Judd

unread,
Nov 27, 2013, 3:02:41 PM11/27/13
to anki-a...@googlegroups.com
yes it's in the collection.media folder both on my computer and in the Anki folder on my phone. I'll put the font-face line above (the instructions on Anki's website said to put it at the end of that section)

Eric Judd

unread,
Nov 27, 2013, 10:38:07 PM11/27/13
to anki-a...@googlegroups.com
put it at the top, didn't change it. not sure what I should be doing instead

binh...@gmail.com

unread,
Jan 1, 2014, 2:52:53 PM1/1/14
to anki-a...@googlegroups.com
I have the same problem after upgrading new version of AnkiDroid :(

wildan...@yahoo.co.uk

unread,
Jan 2, 2014, 3:34:30 PM1/2/14
to anki-a...@googlegroups.com
I have exactly the same problem as Eric Judd with exactly the same ttf file (sbl greek). The file is in the folder on my phone. 

I don't understand what you mean in the last sentence. ("Not sure if putting @font-face after using the actual font-family could also cause an issue, but worth trying.")

I got this to work before but my sdcard broke and it has stopped working and you have changed the fix in the mean time to this @font-face stuff. I tried to do that but it didn't work and now I'm worried it is stopping the original way from working. 

please help

pag.g...@gmail.com

unread,
May 21, 2014, 1:26:36 PM5/21/14
to anki-a...@googlegroups.com, ruediger....@googlemail.com
No news? Ankirdoid still won't display fonts whose name is not written in latin script.

Xiao Sun

unread,
May 21, 2014, 4:20:32 PM5/21/14
to anki-a...@googlegroups.com, ruediger....@googlemail.com, pag.g...@gmail.com
looks like I'm not the only one having the font issue.

Charles J. Daniels

unread,
May 21, 2014, 4:35:01 PM5/21/14
to anki-a...@googlegroups.com
AnkiDroid has something going on with it's "from the media folder" fonts. What I seem to gather is that only .ttf fonts are currently supported (it seems), and sometimes a .ttf file will not work for whatever reason (maybe the actual format isn't quite right somehow). So I recommend trying out different .ttf font files until you find one that works. I know of several people, including myself right now, who successfully use a font from the media folder in our cards.


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
To post to this group, send email to anki-a...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/anki-android/58c43e5c-5eef-467f-99aa-2a3d8e6ad2c7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

pag.g...@gmail.com

unread,
May 25, 2014, 8:38:44 AM5/25/14
to anki-a...@googlegroups.com
I do use custom fonts so I know that some of them work, but unfortunately only a handful of Chinese fonts (those that don't have Chinese characters in their name, like 2% of them) work properly. It's by no means of vital importance, I just wanted to point it out :-) .

Xiao Sun

unread,
May 25, 2014, 11:05:27 AM5/25/14
to anki-a...@googlegroups.com
So it's you Flavio, thank you and Damian for destroy custom fonts for PC users.
Reply all
Reply to author
Forward
0 new messages