Ok since your question explicitly states that you wish to know the method to help you draw parallel horizontal lines, this implementation might be helpful:-
@Preview
@Composable
fun LeafPad() {
val textSize = 25.sp
Box(
Modifier
.fillMaxSize()
.background(Color(0xFFFEFCB5))) {
Canvas(modifier = Modifier.fillMaxSize()) {
var yCord = 0f
repeat(40) {
drawLine(
Color(0xFFB2B461),
Offset(0f, yCord),
Offset(size.width, yCord),
strokeWidth = 2f
)
yCord += 1.8f * textSize.toPx()
}
}
var value by remember { mutableStateOf("") }
TextField(
modifier = Modifier.fillMaxSize(),
value = value,
onValueChange = { value = it },
textStyle = TextStyle(fontSize = textSize, color = Color.Black, lineHeight = (1.8f * textSize.value).sp)
)
}
}
Honestly, looking at your use case, you might want to consider using Pagination instead which features stuff like infinite scrolling, because I assume that for a Text Editor, you would want to scroll down when the user reaches the end of the page, but of course it solely depends on your design and implementation.