Alex Askerov
08/14/2024, 2:03 PMKonstantin Tskhovrebov
08/14/2024, 2:34 PMKonstantin Tskhovrebov
08/14/2024, 2:35 PMAlex Askerov
08/14/2024, 2:42 PMKonstantin Tskhovrebov
08/14/2024, 2:57 PMAlex Askerov
08/14/2024, 4:11 PMAlex Askerov
08/14/2024, 4:14 PMletterSpacing
, it works, but anyway even with zero spacing in not as narrow as default SwiftUIKonstantin Tskhovrebov
08/14/2024, 4:18 PMKonstantin Tskhovrebov
08/14/2024, 4:18 PMAlex Askerov
08/15/2024, 9:04 AMText(
text = "Default font: Whereas recognition of the inherent dignity", fontSize = 18.sp,
)
Text("Default font: Whereas recognition of the inherent dignity").font(.system(size: 18))
Konstantin Tskhovrebov
08/15/2024, 9:24 AMKonstantin Tskhovrebov
08/15/2024, 9:25 AMElijah Semyonov
08/15/2024, 9:30 AMKonstantin Tskhovrebov
08/15/2024, 9:34 AMdefault font weight on Compose and iOS being differentthat is the question
Elijah Semyonov
08/15/2024, 9:44 AMIvan Matkov
08/15/2024, 10:07 AMMaterialTheme
around this text/screen/app - it's expected that it will behave like it should in material world.
Speaking of text layouting itself. Compose does delegate it to SkiaParagraph, the issue here can be only passing wrong parameters here, but currently I'm not sure that it's the case.
Adjusting defaults of foundation.text.BasicText
(not material.Text
) probably makes sense, but it needs to be carefully investigated/compared first. Not only with SwiftUI but also with other layouts. Another good reference is browserAlex Askerov
08/16/2024, 7:33 AMDefault font (compose.ui layer) should be system for sure - we don't want to embed the font because it will increase the app size
In the same time design system (like compose.material3) defines exact look, sizes padding etc - there is no reason for Compose doesn't apply the value that it sets.Yes, agree, that's clear. When I wrote about "somewhere in between" I mean only fonts, nothing more.
Alex Askerov
08/16/2024, 7:33 AMstyle=MaterialTheme.typography.titleLarge
in compose code which set letterSpacing=0
under the hood.
I’ve also tried to set zero letter spacing for default system font. It make it closer to SwiftUI but anyway compose has wider spacing.Alex Askerov
08/16/2024, 7:34 AMIf I understand correctly, Flutter's text rendering is handled by Skia, which delegates text shaping to HarfBuzz. There's an issue on HarfBuzz (link), which complained about HarfBuzz's text tracking deviates from that of macOS in 2019. Although I don't quite get the content in that page and whether the issue was considered fixed.