To create an outlined text you can apply a stroke effect to it but then it leaves the body transparent. What I want to achieve here is
rather than
For creating the stroke effect we only need to have an style like:
TextStyle(
fontFamily = robotoFamily,
fontWeight = FontWeight.Bold,
fontSize = 86.sp,
letterSpacing = 0.86.sp,
lineHeight = 20.sp,
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.surface,
drawStyle = Stroke(
miter = 10f,
width = 10f,
join = StrokeJoin.Miter
),
shadow = Shadow(
color = Color.Gray,
offset = Offset(-16f, 16f),
blurRadius = 8f
)
)
which will result in the second image. The body of the text will be transparent hence the shadow lines behind it are visible.