Custom font in canvas text
suggest changeDraw text on a canvas with a font from assets. x and y are the text baseline in pixels.
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/SomeFont.ttf");
Paint textPaint = new Paint();
textPaint.setTypeface(typeface);
canvas.drawText("Your text here", x, y, textPaint);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents