pretext icon indicating copy to clipboard operation
pretext copied to clipboard

Questions

Open altano opened this issue 8 months ago • 4 comments

This project looks super interesting. I have some (hopefully) quick questions that aren't covered by the readme:

  1. This only runs in a browser, right?
  2. Does it work with arbitrary CSS and custom fonts?
  3. 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

altano avatar Apr 02 '26 08:04 altano

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

kruonos avatar Apr 04 '26 14:04 kruonos

I agree, these points should be addressed in the readme, perhaps under a Q&A section.

coder966 avatar Apr 04 '26 16:04 coder966

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.

beeegee avatar Apr 05 '26 05:04 beeegee

Hey, long time! Taking these in order:

  1. Yes, it needs a browser today: Canvas text measurement plus Intl.Segmenter.
  2. 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-settings aren't modeled. The README caveats list what's covered.
  3. 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.

chenglou avatar Sep 13 '26 03:09 chenglou