top | item 44918411

(no title)

colbyn | 6 months ago

Oh hey good to see some more literature on TextKit2. I remember diving into it when I wrote my proof of concept markdown renderer:

https://github.com/SuperSwiftMarkup/SuperSwiftMarkdownProtot...

It’s a good example of what else you can do with TextKit2, beyond plain text rendering. Here, I can draw text layout fragments in a core graphics context and use typographic information to also render markdown specific graphics in the background or foreground such as markdown tables. One day I’d love to experiment with a markdown centric spread sheet app.

At the time there was so little online info that I had to figure out everything on my own (and no chatbots didn’t have a clue about TextKit2), but STTextView was a great reference. Overall his open source work was very much appreciated. (I should probably say as much in the read me.)

That experiment was also a ton of work that ultimately didn’t go anywhere. Most people would rather just use a relatively subpar embedded browser (i.e. web view).

discuss

order

colbyn|6 months ago

Oh also I’d like to add to the above, the TextKit2 API is way more freeform than people think. You could probably implement your own web browser upon it with optimized line by line text rendering (which isn’t that bad). One thing I always wanted to experiment with is rendering markdown content with horizontally scrollable text fragments for table rows and certain fenced code blocks. Super cool and practical idea for native markdown text rendering. Moreover, in some ways it seems pretty easy to do in TextKit2 since you get very fine grained control over text layout fragment rendering.

nicoburns|6 months ago

> You could probably implement your own web browser upon it with optimized line by line text rendering

I actually have an ambition to do this. I already have most of the layout engine. The use case is for a React Native like framework that can render spec-compliant web content.

krzyzanowskim|6 months ago

we could build a space rocket with it if we only knew how to use it, so it would not glitch