Unable to use custom font

DanielM

Member
Hi,

I've been trying to change the font in Pleco to a Kai family font, but whatever I do just seems to result in all characters to appear as blank spaces.

What I've done:
Open the Custom Fonts panel in the settings pane, pressed "Customize Chinese Font" and then press the font I've been wanting to use (.ttf). For the record, I've attempted to use both Apple's BiaoKai.ttf and Microsoft's SimKai.ttf with the same result.

This is what it looks like:
http://i.imgur.com/BOc7gvl.png
(note: I'm aware I'm using the Beta, but it acted exactly the same before I joined the beta program)

What I've tried:
Killing the app and restarting it
Hard restarting the phone
Put the font file manually in the Pleco font folder
Put a copy of the font file in the Android font folder
Tried different types of fonts
Tried using different keyboards for input
Used handwritten input

My phone: Unlocked HTC One (M7) running the latest version of the software available. Not rooted.

What am I missing? Am I not supposed to just be able to browse to a font file and use it as the standard font in Pleco?

Thanks in advance and thanks for an amazing app
 

mikelove

皇帝
Staff member
Those two specific fonts look like they're not compatible with Android's font renderer - lots of Chinese fonts aren't, sadly. In fairness to Google, this probably isn't something they feel they need to prioritize since, unlike iOS, Android isn't sharing a font renderer with a desktop operating system heavily used by graphic designers.

Anyway, there are several other Kai fonts that do seem to be compatible so I'd suggest that you try some others and see if you have better luck with those.
 

DanielM

Member
That makes a lot of sense, thanks. I tried some different Kai fonts and found one that works and renders nicely for both traditional and simplified characters - AdobeKaitiStd-Regular.otf for those who are interested.
 

Taichi

榜眼
Nice font! But it seems the query word in example sentences doesn't get bolded. Is this font side problem? Or is it someting pleco can make it work?
 

mikelove

皇帝
Staff member
We'd have to add a separate option to install a custom Chinese bold font - the tricks that one would normally use to make fake bold versions of fonts don't really work with Chinese characters (too much detail).
 

Stonefred

Member
Interesting detail: All the fonts that worked on my Nexus 4 (Android 5) do not work on my Nexus 6P (Android 6). In fact, I cannot find any font that works on the Nexus 6P.
 

mikelove

皇帝
Staff member
That's where the "Nexus" brand is misleading - Nexus 4 and 5 were made by LG while the Nexus 6P is from Huawei, and when it comes to font rendering the low-level stuff like hardware drivers matters way more than the Android version or the higher-level skinning / built-in apps / etc.

Since it is a Nexus, though, you might have good luck reporting this issue to Google - with driver issues they sometimes run into a brick wall (as was the case with a couple of Nexus 4 bugs - boiled down to a closed-source Qualcomm driver that Qualcomm refused to update) but you do at least have a good chance of getting somebody at Google to look at + think about the problem which is a lot farther than you're likely to get with a device from say Samsung.

(for reporting purposes you can tell them that Pleco is using the standard "Typeface.createFromFile()" API to load custom fonts, and using them with a standard "Paint.setTypeface()" call, but I suspect if the font doesn't load in Pleco it won't load anywhere else either)

Ironically this is a species of bug we've literally been dealing with for a decade now - back on Windows Mobile, Microsoft never thought to test their custom font loading mechanism with Chinese fonts and custom Chinese fonts accessed from SD cards would frequently fail to work.
 
Top