Hi Everybody,
To maximise a Text dynamically within its frame, I am using the "large fixedSize with small minimumScaleFactor" trick. This works fine for single Texts but when using it on an HStack of Texts, each Text is scaled individually, meaning font size of Text1 is smaller than Text2 in this example:
HStack {
Text("firstLongRandomString").background(.green)
Text("2nd")
}
.frame(width: 300)
.lineLimit(1)
.font(.custom("Arial", fixedSize: 999))
.minimumScaleFactor(0.01)
.padding()
Is there a way to ensure that both Texts scale to the same font size? Note that I cannot concatenate the Texts, as one has a background (or another modifier) which makes it a view type.
Thank you very much for your insights!
Cheers
devflo