Issue
Android's Japanese font is horrible. The free Mincho font would be much better. Many people use our (open source) app to learn Japanese words, so we would like the app to download and use this font.
An existing free Android app is already doing it, but I have no idea how.
Downloading the font to the SD card is no problem, but how to make the WebView (or some spans within the WebView) use the downloaded font instead of the default font?
Solution
The solution was to insert a CSS directive into the HTML sent to the WebView. This CSS directive references the font file via the "file:" protocol.
For an open source code sample and a more detailed explanation, see how we implemented it:
https://github.com/nicolas-raoul/Anki-Android/commit/6225e524be4a77858e08389624d2f4ae8740261b
Answered By - Nicolas Raoul
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.