I would like to use the external font Impact on my android app. Currently the code that lets me use my font looks like this:
Paint textPaint = new Paint();
textPaint.setAntiAlias(true);
textPaint.setTextSize(FONT_SIZE);
textPaint.setColor(0xFFFFFFFF);
Log.i(TAG, "- Paint: " + textPaint);
Typeface face = textPaint.getTypeface();
Log.i(TAG, "- default typeface: " + face);
face = Typeface.DEFAULT_BOLD;
Log.i(TAG, "- new face: " + face);
textPaint.setTypeface(face);
but that results in a bad generic version of the font I want to use. For those of you not familiar with the Impact font, its the font that allows you to make meme’s. Does anyone know what I should do to be able to use Impact font instead of the DEFAULT_BOLD?
Use
canvasto draw text,TextViewcan usesetTypefacemethod to do this;