StyledTextKit icon indicating copy to clipboard operation
StyledTextKit copied to clipboard

Is it possible to create a string with mixed fonts / font sizes?

Open eliburke opened this issue 6 years ago • 0 comments

I'm trying to create a string that has a mix of two font sizes, but I can't seem to make it work. Is this supported by StyledTextKit? (if not, would this be addressed by issue #61 ?)

Here's a sample of what I tried. Adding calls to save() / restore() don't affect the behavior, nor does changing the contentSizeCategory

let attrStr = StyledTextBuilder(text: "")
        .add(text: "Foo", attributes: [.font: UIFont.systemFont(ofSize: 32)])
        .add(text: "Bar", attributes: [.font: UIFont.systemFont(ofSize: 14)])
        .build()
        .render(contentSizeCategory: .unspecified)

eliburke avatar Dec 10 '18 21:12 eliburke