Still can't get EPSON 教科書体M to work

1,096 views
Skip to first unread message

sola...@gmail.com

unread,
May 10, 2015, 4:25:37 PM5/10/15
to anki-a...@googlegroups.com
Has anyone ever got the Epson fonts to work with AnkiDroid?  I've seen a few posts about trouble with them, e.g., here.

Most of my other fonts work (using the @font-face method).  I've tried this with and without ASCII characters in file name, but no luck:
@font-face { font-family: font3; src: url('_epkyouka.ttf'); }
@font-face { font-family: font3; src: url('_EPSON 教科書体M'); }

ospalh

unread,
May 11, 2015, 7:07:21 AM5/11/15
to anki-a...@googlegroups.com


Am Sonntag, 10. Mai 2015 22:25:37 UTC+2 schrieb Earthlark:
Has anyone ever got the Epson fonts to work with AnkiDroid?  I've seen a few posts about trouble with them, e.g., here.

I think it is actually a problem with the fonts.
They worked for me with Android 4.1.1, AnkiDroid 2.4.3
And did not work any more with Android 4.4.2, AnkiDroid 2.5alpha30.
(My wild guess is that Google closed a few font related security holes and maybe the old Epson font was effected as a (i hope!) false positive.)

What i did was load the font into FontForge and simply save there again. (“Font herstellen” with a German UI, something like “Create font”.)

Screen shots, one with the old, twice the same font, one with the new, once the default font ("EPSON 教科書体M" not loaded), once the font forged font loaded.
Also, the test deck.
Not included: the two font files.


P.S.: #&@}! Google Groups is putting the images wherever it wants. Not where i want them.

教科書体デーも.apkg

Houssam Salem

unread,
May 11, 2015, 6:32:54 PM5/11/15
to anki-a...@googlegroups.com
Android 4.4 is when Google replaced the WebView backend with the Chrome engine and is also when a lot of fonts stopped working. Deep down we all know there is a Very Good Reason™ why they are now rejecting these fonts but I haven't bothered to look into it.

Did you just demonstrate that rebuilding a font yourself makes it work again? 

ospalh

unread,
May 12, 2015, 6:11:47 AM5/12/15
to anki-a...@googlegroups.com
Here we go:

How to rescue the Epson “ttf30” and possible other fonts.

A step-by-step guide on how to use fonts in AnkiDroid that work with Anki desktop but not with Android 4.4 (KitKat).

Not all steps are all that easy. Sorry. Also, it worked for me, but may not work for you.

  1. Make sure that the font works with Anki desktop. Use the `@font-face`-method described in the Anki desktop manual.
  2. Make sure you have a backup of the font file. Copy the file rather than move it to the collection.media folder, or copy it out of that folder when it is there already.
  3. Stop Anki desktop. Fore stop AnkiDroid. (Just to make sure that the new fonts will be used after this procedure, and, on Windows, that the font file is not open when we replace it.)
  4. Get FontForge
  5. Install it.
  6. Get it running.
  7. Load the copy of the font file that is not in the collection.media folder.
  8. There may be some warnings. Just ignore that window.
  9. In the main edit window, select `File/Generate Fonts…`
  10. Make sure the type is set to `TrueType`
  11. Navigate to the AnkiDroid media folder, typically `<…>\Documents\Anki\User 1\collection.media`.
  12. Pick the right ttf file there. Click Save.
  13. Replace
  14. There may be an “Errors detected” window. Click Save. If you are out of luck the errors are so bad that the font will still not work after this procedure. In that case you will have to learn how to really use FontForge and fix the errors. Or use another font.
  15. Restart Anki. Make sure the font still works.
  16. Sync on the desktop. Check that the font file is synced (amount of data transferred)
  17. Restart AnkiDroid.
  18. Sync on your Android device. Check again that enough data is transferred.
  19. Review. The font should work.

ospalh

unread,
May 12, 2015, 6:28:08 AM5/12/15
to anki-a...@googlegroups.com

Two PSs:

On Linux, you should install FontForge through the package manager (see 4, 5)


Instead of doing

"<span class="mystyle">{{FieldName}}</span>"

"@font-face { font-family: myfont; src: url('_arial.ttf'); }

.mystyle { font-family: myfont; }

.mac .mystyle { font-family: Helvetica; }",

you can do it in one "font-family" definition:

"<span class="swiss_style">{{FieldName}}</span>"

"@font-face { font-family: local_hel; src: url('_helvetica.ttf'); }

.swiss_style { font-family: "local_hel", "Helvetica", "Bitsream Vera", "Arial", sans-serif;}"


(When you insist on using those fonts, that is.)

Andreas Klauer

unread,
May 12, 2015, 7:22:31 AM5/12/15
to anki-a...@googlegroups.com
Am Dienstag, 12. Mai 2015 12:11:47 UTC+2 schrieb ospalh:
How to rescue the Epson “ttf30” and possible other fonts.

Thanks! The Epson fonts stopped working for me after switching Cyanogen mod 10 -> 11. Glad I'm not alone with this issue.

If you have problems with fontforge, there is an alternative called "ttx/fonttools" that does the trick also.

$ ttx _epkyoukasho.ttf
Dumping "_epkyoukasho.ttf" to "_epkyoukasho.ttx"...
$ ttx _epkyoukasho.ttx
Compiling "_epkyoukasho.ttx" to "_epkyoukasho#1.ttf"...
xml.parsers.expat.ExpatError: reference to invalid character number: line 1608611, column 52

Whoops. What happened? If you open the .ttx XML file and jump to that line, you'll see several &#0; in the font name. Remove them and try again.

$ ttx _epkyoukasho.ttx
Compiling "_epkyoukasho.ttx" to "_epkyoukasho#1.ttf"...

And the resulting TTF file works just fine. Yay!

sengok...@gmail.com

unread,
Dec 1, 2015, 12:05:13 AM12/1/15
to AnkiDroid

I upvote this solution.
Just like you did Sir, I installed font tools in Ubuntu, used the commands, encountered the &#0; and recompile it and got solved.
Nobody would notice that &#0; is causing the problem. Really helpful solution

2015年5月12日火曜日 19時22分31秒 UTC+8 Andreas Klauer:

artur.u...@gmail.com

unread,
Mar 30, 2020, 1:05:22 PM3/30/20
to AnkiDroid
I thank you so much.
I tried to make it work for 2 days and it just didnt work
Now i tried your mentioned steps and it worked.
Thank you, i just wanna cry!!! T_T
Reply all
Reply to author
Forward
0 new messages