Questions
This project looks super interesting. I have some (hopefully) quick questions that aren't covered by the readme:
- This only runs in a browser, right?
- Does it work with arbitrary CSS and custom fonts?
- Any idea how much faster than Satori this is?
p.s. Cheng, I believe we met back in your Reason advocacy days, so hello again :p
Hi, from what I tested, it do not only run on browser, you can now use it in swift as someone ported the framework to it, so now it is possible to make applications using the framework --> https://x.com/tornikegomareli/status/2039516374788124865 question 2 and three I have no idea, but perhaps yes, and if not, some tweaks could make it possible to custom fonts and arbitrary css works
I agree, these points should be addressed in the readme, perhaps under a Q&A section.
Fixed in #101.
I added a small FAQ to the README that answers the browser-only question, the CSS/custom-fonts scope question, and points people to the current benchmark snapshots.
Hey, long time! Taking these in order:
- Yes, it needs a browser today: Canvas text measurement plus
Intl.Segmenter. - Custom fonts work once they're loaded, as long as the font string you pass matches your CSS. Arbitrary CSS doesn't: Pretext targets common app text settings, and extras like
font-feature-settingsaren't modeled. The README caveats list what's covered. - I haven't compared them, since they do different jobs. Satori is its own renderer: it lays out a CSS subset with a flexbox engine, shapes text from font files you pass in, and draws SVG, mostly for images on a server. Pretext runs inside the browser and predicts how that browser will wrap your text, without touching the DOM.
Closing, but ping me with anything else.