ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.35k stars 2.18k forks source link

Random font #1946

Closed hssm closed 9 years ago

hssm commented 9 years ago

Originally reported on Google Code with ID 1044

When displaying a card, use a random font (from all system fonts, or from all fonts
in the "fonts" directory, or a selection, I haven't thought about the details)

Rationale:
- I am using Anki to recognize Japanese characters accurately
- The font of an Anki card's question is not something you usually change often
- In real life there are lots of Japanese fonts, and sometimes I lack reading speed
reading kanjis in a special font, whereas I would have no problem if it were my usual
font.

I want to train at recognizing a character in any font, not train at recognizing a
character in a particular font.

See: https://groups.google.com/d/topic/anki-android/WvFO1aebI0s/discussion

Reported by nicolas.raoul on 2012-03-09 08:24:39

hssm commented 9 years ago
I'm not sure this needs to be an explicit feature, as you can embed some javascript
in your card templates to automatically change the font already. There's precedent
for such an approach, such as http://ankisrs.net/docs/FrequentlyAskedQuestions.html#_i_want_to_add_a_hint_i_can_selectively_show

Reported by dae@ichi2.net on 2012-03-09 10:03:17

hssm commented 9 years ago
Hi Damien!
Great idea indeed :-)

Reported by nicolas.raoul on 2012-03-09 10:10:05

hssm commented 9 years ago
Requiring the user to add javascript and customize cards is different from Anki seamlessly
offering different fonts.  I think this would be a great feature.

Grabbing a random font from the system's font list could be problematic, what if some
fonts are Latin, some Chinese, some Korean, etc.  What about symbol fonts?  Plus, there
are fonts that are not disfluent but merely irritating, like Chicago.  

To choose the fonts, I would suggest an interface as close as possible to Photoshop's
font picker.  If the user doesn't know or doesn't care, Anki could show a list of commonly
used fonts.  For Chinese, this would be Simsun, MingLiu, SimHei, and so on.  For English,
Arial, Verdana, Times New Roman, Garamond, etc.  I don't know if all Android devices
have the same system fonts.  If they do than it makes this part easier. 

Reported by shirtsNB on 2012-03-09 10:42:35

hssm commented 9 years ago
One problem with that will need to be handled while implementing this is that not all
fonts completely handle the character set you're studying. Anyone know an automated
test to see if a font implements a... I'm not sure of the correct term... language
/ character set?

One boundry case I'm curious about but probably isn't important for the feature is
partial korean characters on my android handset, like these ㅗㅈㅇㅕ.

Reported by BodeyBaker on 2012-03-10 06:09:08

hssm commented 9 years ago
BodeyBaker: I asked a similar question on StackOverflow 6 months ago but nobody seems
to know:
http://stackoverflow.com/questions/7683753

Reported by nicolas.raoul on 2012-03-10 06:15:18

hssm commented 9 years ago
I guess we have to depend on the user to tell us which language he's studying.  Then,
rotate a list of matching stock Android fonts for that language.  I volunteer for this
project, but I know almost nothing.  Can someone give me some tasks to accomplish to
move this forward?

Reported by shirtsNB on 2012-03-10 06:45:38

hssm commented 9 years ago
Hello shirtsNB,
Thanks for stepping forward!
Here is something anyone can do and that we really need:

For each "writing system" (for instance: Japanese, Arabic, Cyrillic, Latin, Hebrew,
etc) find around 5 font files that are freely reusable.
"freely reusable" means public domain, or available under another open source licenses.
You can post your results here.
For each font: name, license, URL where it can be downloaded, supported writing system(s)

Thanks in advance!

Reported by nicolas.raoul on 2012-03-10 17:09:23

hssm commented 9 years ago
According to <a href="http://stackoverflow.com/questions/6558866/how-to-check-installed-fonts-on-android-device">this
link</a>, there are only three stock fonts on an Android phone.  So, we definitely
need extra fonts.

I will find fonts for:
Chinese (simplified)
Chinese (traditional)
Japanese
Korean
Latin
Arabic
Cyrillic
Hebrew 

Any more?

Reported by shirtsNB on 2012-03-11 05:36:02

hssm commented 9 years ago
shirtsNB: If you manage to find for all those that would be great already :-)

As usual, anyone is welcome to help :-)
If you know good open-source fonts, please tell us!

For the next steps, here is a tool that could be used to understand which font can
be used for which characters: https://code.google.com/p/sfntly/
For an explanation read paragraph "Getting list of characters in each font" at http://stackoverflow.com/a/9666434/226958

Reported by nicolas.raoul on 2012-03-12 15:53:06

hssm commented 9 years ago
Interesting. I wonder how well a pre-indexed implementation would work. Vendors seem
to like customize the look and feel. Although, I suppose most fonts are at least copyrighted.
Do we know what version of a font resides on a device from the application? 

Reported by BodeyBaker on 2012-03-12 16:33:26

hssm commented 9 years ago
I created an Open Source project that might help:
https://github.com/nicolas-raoul/Antisquare

Reported by nicolas.raoul on 2012-03-13 09:20:21

hssm commented 9 years ago
Here is the list, as complete as I could make it.  I didn't found any suitable fonts
for Japanese, Korean, or Arabic.  All of the 'free' fonts I've found in these languages
have no license information.  Properly licensed Simplified Chinese fonts are apparently
very hard to find, especially dysfluent fonts.

Reported by shirtsNB on 2012-03-21 17:25:11


hssm commented 9 years ago
Thanks a lot for your help shirtsNB!
Especially nice to see that you included license information for every font :-)
I realize that the wiki is a better place to maintain this list.

I added you as a project committer so that you can edit the wiki, and started adding
your content to this wiki page:
http://code.google.com/p/ankidroid/wiki/FreelyDistributableFonts

Could you please finish the formatting there?
If you find more fonts, please add them directly there :-)

Here are 3 other fonts, we should move that info to the new page, if license info can
be found (if no license info let's just delete them):
http://code.google.com/p/ankidroid/wiki/Installation#Custom_fonts

Maybe Japanese/Korean/Arabic/Thai/etc fonts can be found in the Debian project?

Reported by nicolas.raoul on 2012-03-22 03:20:39

hssm commented 9 years ago
I did my best to clean up the formatting.  However, the Chinese section is messed up,
I don't know why.  Leave it to Google to use bizarre table layout like || and = instead
of HTML.

Reported by shirtsNB on 2012-03-26 14:17:21

hssm commented 9 years ago
Thanks a lot shirtsNB!
I fixed the table layout with a space character, might be a bug in Google's wiki engine.

I think both the URL and DOWNLOADS links are important. Actually, URL should be renamed
PROJECT WEBSITE, that is the people who make the deck can be contacted, and license
info is also often explained there.
Cheers!

Reported by nicolas.raoul on 2012-03-26 16:04:02

hssm commented 9 years ago
Well, it's not that easy.  There is no project website for the Chinese fonts, it's just
a directory with a license file, http://apt.nc.hcc.edu.tw/pub/FreeSoftware/free_fonts/wangttf/.
 There are pages at http://www.wazu.jp/gallery/Fonts_ChineseTraditional.html and http://www.wazu.jp/gallery/Fonts_ChineseSimplified.html
but they're just some pages someone has made, which includes many links to non-free
fonts as well.  Openfontlibrary.org uses custom download links for each file.  

Reported by shirtsNB on 2012-03-26 16:29:14

hssm commented 9 years ago
I have to agree with Damien; the switching of the font should be handled in the card
content itself (via javascript). By the way, great work on building the list of open
source fonts shirtsNB!

Reported by perceptualchaos2 on 2015-06-02 07:52:44

shirts-zz commented 9 years ago

The page http://code.google.com/p/ankidroid/wiki/FreelyDistributableFonts is missing, did it survive the migration?

Stupid Google, why do you have to delete everything?

flerda commented 9 years ago

This is the new location for the page. https://github.com/ankidroid/Anki-Android/wiki/Freely-distributable-fonts