in benchmarks/desktop/src/main/kotlin/ParagraphBenchmark.kt [32:71]
fun builderBenchmark(): Paragraph {
return Paragraph(
text = text,
style = TextStyle(
color = Color.Black,
fontSize = 14.sp,
fontFamily = italicFont
),
spanStyles = listOf(
AnnotatedString.Range(
SpanStyle(
color = Color(0xff964B00),
shadow = Shadow(Color.Green, offset = Offset(1f, 1f))
),
10, 19
),
AnnotatedString.Range(
SpanStyle(
background = Color.Yellow
),
19, 29
),
AnnotatedString.Range(
SpanStyle(
fontSize = 2.em
),
29, 48
),
AnnotatedString.Range(
SpanStyle(
color = Color.Green
),
25, 35
),
),
width = 200f,
density = Density(1f),
resourceLoader = fontLoader
)
}