📅  最后修改于: 2022-03-11 14:52:43.855000             🧑  作者: Mango
// Kotlin language
val fm = paint.fontMetrics
val lineHeight = fm.bottom - fm.top + fm.leading
mText.split("\n").forEachIndexed { idx, line ->
val baseline = idx * lineHeight + (-fm.top) // fm.top is negative
canvas.drawText(line, 0f, baseline, paint)
}