Font-awesome 显示一些奇怪的图标

Font-awesome is showing some weird icons

我在 Android 应用程序中使用了很棒的字体。它没有显示真正的图标。相反,我收到了一些奇怪的文字。例如,我期待看到 arrow-left 而我得到的是这个(如图所示)。

android:text="@string/fa_arrow_left"

userTV.setTypeface(TypeFaces.get(this.getApplicationContext(), "fa"));

这是字体 Class。

public class TypeFaces {
    private static final Hashtable<String, Typeface> cache = new Hashtable<String, Typeface>();

    public static Typeface get(Context c, String name) {
        synchronized (cache) {
            if (!cache.containsKey(name)) {
                Typeface t = Typeface.createFromAsset(
                        c.getAssets(),
                        String.format("fonts/%s.ttf", name)
                );
                cache.put(name, t);
            }
            return cache.get(name);
        }
    }
}

在strings.xml<string name="fa_arrow_left">&#xf060;</string>

fa.ttf放在main > assets > fonts

已从 https://github.com/FortAwesome/Font-Awesome/blob/master/fonts/fontawesome-webfont.ttf

下载字体

反正就是

啊!解决了。实际上,该角色的代码在我使用的版本中不可用。从 fontawesome 网站下载了最新的字体并且它有效。解决问题花了一整天。感谢所有在后台尝试帮助我的人。