How to get the right font size drawing the text?
what I want is to get the right font size that fit the height in [11,12,16] when height = 11 and I want to get the right font size of the text. and I use that font size will get the max height 11 of the text. fontSize=30; while(true) { bitmap = Bitmap.createBitmap(306, 90, Bitmap.Config.Argb8888); canvas.drawColor(Color.ParseColor("#000000")) _paint.setTextSize(fontSize); ...get the height if(height==11){ return fontSize; } fontSize--; } first I will set the fontSize=30 and then get height of the text using pixel.and then fontSize--; then I will the the fontSize that height =11; but actually I
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.