I have odd behaviour on my Nexus 7
I have been using Sassoon Primary ttf to draw a single letter using drawText on the center of a canvas in my own view. This has been working fine on all models I have tested except my nexus 7.
all letters still work except lower-case f and j
I have tested on 4.2.2 emulator and it works fine as well as 4.0.3 , 4.1.2 and 2.3
For good measure I have set it back to default font and it now draws F but not J.
Has anyone had the same problem or can recreate?
My Paint
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setTextSize(650);
textPaint.setAntiAlias(true);
textPaint.setTextAlign(Align.CENTER);
textPaint.setTypeface(font);
textPaint.setDither(true);
the onDraw command
canvas.drawText(letter, center, center, textPaint);
EDIT: turns out its the size 650, which i need it to be. When lowered this then worked. How can I keep it at the size I need?
Thanks
You are using a font size that's way too big to fit in the font cache. You could use a combination of a smaller font size and a scale transform on Canvas to achieve the effect you want. You could also use a software layer (see View.setLayerType()
) on the View that draws the letter.