0

the design recommendation for android regarding text legibility (https://material.io/design/color/text-legibility.html#legibility-standards) says to use for the font a black color with Alpha 87% or 60% depending on the importance of the text. So I paint text on my canvas like this :

paint.setColor(#99000000);
canvas.drawText('a text  with emoji', x, y, paint);

This work well for the text, It looks a little grayed and not pure black, however, the emoji is also painted with the alpha and for a colored image, this is not good to use Alpha to draw it :(

On iOS, for example, emoji are drawn without taking care of the alpha of the font color. Is there any way under Android to draw a text on the canvas with font color alpha that will be applied only to the text and not for the emoji contained in the text?

zeus
  • 12,173
  • 9
  • 63
  • 184
  • I began finding an answer then I realized you needed it for paint, not for TextView... Spans would have worked otherwise. I still have it if you need. – Nicolas May 04 '20 at 01:06
  • @Nicolas no unfortunatly I need it for paint :( – zeus May 04 '20 at 10:15

0 Answers0