I've been struggling with this issue for a while:
I'm using canvas to draw text onto the screen, for my Android app. Right now, I'm using this to scale the text size:
float scaledTextSize = textSize * getResources().getDisplayMetrics().density;
paint.setTextSize(scaledTextSize);
It does scale a little bit, but doesn't fully keep its "size ratio" compared to the current screen dimensions. I've also tried the method using a dimension from a resource file, but nothing changed.
For example, if I set the text size to be suitable for a Nexus 5 screen, it would be too small for a Nexus 7, and a little bit too big for a Nexus 4.
Any help would be appreciated!