Created
March 25, 2023 06:10
-
-
Save imandaliya/1fdfa882a31dda0e4393afd656334119 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove font/typeface padding from drawn text in canvas | |
Paint.FontMetricsInt fontMetricsInt = new Paint.FontMetricsInt(); | |
textPaint.getFontMetricsInt(fontMetricsInt); | |
canvas.translate(0, fontMetricsInt.top - fontMetricsInt.ascent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment