Post

Replies

Boosts

Views

Activity

Reply to Custom fonts with AttributedString and Markdown
Ah -- NSPresentationIntent! That looks very useful to help me identify, say, the bold ranges in order to replace that intent with a custom font. I'll try this once FB9148035 is resolved. This looks much better than the attributes used when NSAttributedString is created via HTML. It would be even better if I could supply rendering style hints to help the rendered know how to apply various intents, though, since right now I assume UIKit must be using a hardcoded mapping of intent attribute -> styling (font etc).
Jun ’21
Reply to AttributedString with UIKit?
Thanks; I've filed FB9148035 for the missing attributes when rendering with UILabel.attributedText = NSAttributedString(text). One note, though: it's difficult to determine whether the attributes are part of the supported scope as those aren't documented -- I have to browse the Swift definition itself (AttributeScopes.uiKit) to try to determine that. In this case it certainly looks like the lost attributes (bold, paragraph break, unordered list) are meant to be supported.
Jun ’21