textflow
textflow copied to clipboard
Drop cap spacing issue
Hi all, we are seeing a glitch with the drop cap:
The last line of the drop cap and the first line of the full-width text seem to have a wrong spacing. Is there actually a problem in lib, or am I holding it wrong?
This is my current implementation:
TextFlow(
text = story.text.substring(1),
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
.let {
when (windowSizeClass.widthSizeClass) {
WindowWidthSizeClass.Compact -> it
else -> it.requiredWidth(600.dp)
}
},
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
fontFamily = fontFamily,
) {
Text(
text = story.text.substring(0, 1),
fontFamily = FontFamily(Font(R.font.griffin_two_plain)),
fontSize = 74.sp,
)
}
Thanks 🙏
Hey 👋
Thx for trying a lib, I have seen it in AI Bedtime Stories 😄 Awesome idea, btw 👍
Looks like you are using M3, but TextFlow is build on M2, this could cause some issues 🤔
I am playing around with an idea to release also M3 version as a separate artifact.
However, I have several question:
- Which version of Compose you are using?
- Do you override
includeFontPaddingsetting inPlatformTextStylefor your typography? - Could you share your font family used for
TextFlow? - Could you share your typography setup?
Thanks in advance 🤌
@hamen Hey 👋
Just a friendly ping, if you have time to check it? ☝️