Шрифт потрясающий текст не является твердым в Android - PullRequest
0 голосов
/ 22 ноября 2018

Я пытаюсь показать значок указателя руки, который https://fontawesome.com/icons/hand-pointer?style=regular
Я хочу показать его полностью (белый фон), как этот https://fontawesome.com/icons/hand-pointer?style=solid.
Но здесь у меня естьпроблема в том, что оба они имеют один и тот же Unicode, который f25a .

//This is the FontAwesomeTextView I Created
FontAwesomeTextView fingerPointer = new FontAwesomeTextView(MyApplication.getStaticContext());
        fingerPointer.setText(MyApplication.getStaticContext().getString(R.string.finger_pointer));
        fingerPointer.setTextColor(ContextCompat.getColor(MyApplication.getStaticContext(), R.color.colorWhite));

        fingerPointer.setShadowLayer(2,2,2,R.color.colorOrange);
        fingerPointer.setTextSize(30f);
        fingerPointer.setVisibility(View.GONE);
        this.fingerPointer = fingerPointer;

//This is the hand pointer text that I am using
<string name="finger_pointer" translatable="false">&#xf25a;</string>

Как вы можете видеть значок, который я отправляю по ссылке, имеет тот же Unicode в string.xml.

Это мой FontAwesomeTextView, довольно простой класс, который загружает fontawesome гарнитуру и устанавливает его.

public class FontAwesomeTextView extends AppCompatTextView {


    public FontAwesomeTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    public FontAwesomeTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FontAwesomeTextView(Context context) {
        super(context);
        init();
    }

    private void init() {
        Typeface typeface = FontCache.get(FontCache.FONT_AWESOME,getContext());
        setTypeface(typeface);
    }

}
...