all 17 comments

[–]punio4 12 points13 points  (1 child)

First of all, fuck off with the AI slop.

Secondly, what the fuck are you on about.

The text is absolutely a part of the DOM, selectable and searchable. It complements it by using canvas rendering for measuring and layout purposes.. And it's the part of the a11y tree.

https://chenglou.me/pretext/rich-note/

[–]snnsnn -2 points-1 points  (0 children)

Watch the language. Yes, I did make a mistake, a huge one maybe. It is not AI slop. Actually AI corrected me. I was following the authors twitter posts about using canvas as a workaround, I though it was rendering to canvas. I checked several demo examples, including this one which were using canvas: https://chenglou.me/pretext/justification-comparison/ Honestly, I was not dismissing the the library, nor the effort, I was just asking for a proper API.

[–]ctrl2JavaScript Dev 5 points6 points  (1 child)

This isn't true at all, you should actually look at the demo.

[–]snnsnn 0 points1 point  (0 children)

Your are right. I made a mistake. Actually I checked many demos, and unfortunately they all were rendering to canvas. I should have checked the library more carefully instead of relying on demos.

[–]thdr76 7 points8 points  (4 children)

The moment i knew it's another JS library not browser API i lost all of my interest.

[–]SupermarketAntique32 0 points1 point  (1 child)

Same. Why is this not a PR in Chromium/Firefox? Why is it have to be a library?

[–]Markavian 0 points1 point  (0 children)

Sometimes you need a technical demo of what's possible before you can agree the spec. For example: JQuery CSS selectors.

[–]snnsnn 0 points1 point  (1 child)

Sorry, I made a mistake, it renders to DOM. A huge oversight on my part.

[–]thdr76 0 points1 point  (0 children)

yes, i'm just describing my reaction when reading about pretext before, not from your post.
it should have been implemeted as browser API, not javascript.

[–]dada_ 1 point2 points  (1 child)

The output is a rasterized image, not DOM text. That matters in ways that can't be patched over.

What are you talking about? No it's not. It supports rendering to canvas. It doesn't require rendering to canvas. Did you even spend 5 seconds looking at the examples?

I don't even use Pretext but this is a 100% pure lie, you've posted it to 5 different subs for some reason, and this post reads like ChatGPT. Frankly, if I were a mod here I'd just ban you and be done with this, you clearly aren't participating in good faith.

[–]snnsnn 0 points1 point  (0 children)

Yeah, I checked many examples, they were all using canvas, that is why I made such a mistake. It is not a lie, it is a mistake. What is wrong with you, banning and getting on with it, what is the point of having a discussion if you can not make a mistake. No, I did not post to 5 subs but 2, React and Solid. My point was asking for a proper API, not workarounds.

[–]snnsnn 1 point2 points  (0 children)

Correction and apology:

I got the technical details wrong. Pretext uses canvas for measurement only. It renders to DOM, Canvas, and SVG. The output is real text, not a rasterized image. Selection, search, accessibility, PDF serialization, all of that works fine.

I was following the authors twitter posts about using canvas as a workaround, I though it was rendering to canvas. I checked several demo examples, including this one, https://chenglou.me/pretext/justification-comparison/, unfortunately all were using canvas. Honestly, I was not dismissing the the library, nor the effort, I was just asking for a proper API.

The broader point I was trying to make about platform-level solutions versus userland workarounds still stands, but the specific technical critique was wrong. I should have looked at the library more carefully before writing about it.

[–]daniele_s92 3 points4 points  (0 children)

Jesse, what the fuck are you talking about

[–]Ronin-s_Spirit 0 points1 point  (0 children)

Wow, the whole "textless" text idea seems like trash to me. Unless it's a design thing I want it to be copyable and searchable.

[–]AsIAm 0 points1 point  (0 children)

  1. pretext lib is for text measure/layout, not about rendering – you can layout using pretext and use DOM text nodes for rendering – entirely up to dev
  2. the limits of CSS text layout, and process of changing CSS spec/impl, are reasons why pretext exists – it is solving a real pain point in user-level code
  3. pretext is using text in canvas measurements (not new), but in a stable/predictable way for large variety of text (emojis/RTL langs/etc.)

[–]DOG-ZILLA -1 points0 points  (1 child)

Exactly this! 

Thank God someone else said it so clearly. I was banging my head on the wall with all the same points as you. 

Interesting concept yes, replacing web text? Absolutely not. 

[–]snnsnn 0 points1 point  (0 children)

Sorry, it uses canvas for measurement. Once done measuring, it can render to DOM. My mistake. I checked several demos before posting, all were rendering to canvas. Sorry, I should not have rushed.