1// Kotlin language
2val fm = paint.fontMetrics
3val lineHeight = fm.bottom - fm.top + fm.leading
4mText.split("\n").forEachIndexed { idx, line ->
5 val baseline = idx * lineHeight + (-fm.top) // fm.top is negative
6 canvas.drawText(line, 0f, baseline, paint)
7}