bs4: alignment engine #79

Closed
opened 2026-01-29 14:55:47 +00:00 by claunia · 3 comments
Owner

Originally created by @kristopolous on GitHub (May 5, 2020).

I have this sick fantasy that there may be a way to coerce horizontal and or vertical character alignment to mock the character displays of cga/ega without:

  • using javascript
  • requiring any extra html
  • limiting the viewport to say "x" number of characters. The user resizes the window and the document flows naturally across while at the same time maintaining pixel alignment

Before (v2/v3) I did this very painfully by taking screenshots, doing careful calculations, comparing the rendering engines of the different browsers, using guide lines and even at one point using a usb microscope to check actual pixels.

That was all fun and games but in the brave new world of perverted hacks I've gotten the batshit idea that the modern css systems can handle this. this thread will be my exploration.

Also and perhaps most importantly this will allow me to solve the centering problem ... once there's an odd number of characters things break. Again, yes, javascript, got it, totally possible ... don't want to use it, this project isn't about being practical, it's about pornographic programming

Originally created by @kristopolous on GitHub (May 5, 2020). I have this sick fantasy that there may be a way to coerce horizontal and or vertical character alignment to mock the character displays of cga/ega without: * using javascript * requiring any extra html * limiting the viewport to say "x" number of characters. The user resizes the window and the document flows naturally across while at the same time maintaining pixel alignment Before (v2/v3) I did this very painfully by taking screenshots, doing careful calculations, comparing the rendering engines of the different browsers, using guide lines and even at one point using a usb microscope to check actual pixels. That was all fun and games but in the brave new world of perverted hacks I've gotten the batshit idea that the modern css systems can handle this. this thread will be my exploration. Also and perhaps most importantly this will allow me to solve the centering problem ... once there's an odd number of characters things break. Again, yes, javascript, got it, totally possible ... don't want to use it, this project isn't about being practical, it's about pornographic programming
Author
Owner

@kristopolous commented on GitHub (May 5, 2020):

my most recent attempt was to use the <col>'s align="char" feature which has been deprecated for a while now. Here it is in HTML 4.01 (https://www.w3.org/TR/html401/struct/tables.html#adef-charoff). As an interesting thing, this leads to a strange underused version of CSS's text align:

align: [ col alignment character ] center

I can't find this in any w3 spec but mdn has it in their wiki: https://developer.mozilla.org/en-US/docs/Web/CSS/text-align

Now this is all good, maybe we have some perverse way of doing this ... however, if you take the example out of the HTML spec and put it into a modern browser you'll see it totally and completely ignores it. It's not only deprecated but it's also apparently unimplemented. So this is a no-go

@kristopolous commented on GitHub (May 5, 2020): my most recent attempt was to use the `<col>`'s `align="char"` feature which has been deprecated for a while now. Here it is in HTML 4.01 (https://www.w3.org/TR/html401/struct/tables.html#adef-charoff). As an interesting thing, this leads to a strange underused version of CSS's text align: align: [ col alignment character ] center I can't find this in any w3 spec but mdn has it in their wiki: https://developer.mozilla.org/en-US/docs/Web/CSS/text-align Now this is all good, maybe we have some perverse way of doing this ... however, if you take the example out of the HTML spec and put it into a modern browser you'll see it totally and completely ignores it. It's not only deprecated but it's also apparently unimplemented. So this is a no-go
Author
Owner

@kristopolous commented on GitHub (May 5, 2020):

an earlier model was trying to use the w3c's rhythmic sizing feature of line-height-step which looks like it can perhaps maybe I dunno, get vertical alignment to be guaranteed? I don't know how ... but it does do the stepwise thing that I need

https://drafts.csswg.org/css-rhythm/#line-height-step

@kristopolous commented on GitHub (May 5, 2020): an earlier model was trying to use the w3c's rhythmic sizing feature of `line-height-step` which looks like it can perhaps maybe I dunno, get vertical alignment to be guaranteed? I don't know how ... but it does do the stepwise thing that I need https://drafts.csswg.org/css-rhythm/#line-height-step
Author
Owner

@spotUP commented on GitHub (May 20, 2020):

Cool!

@spotUP commented on GitHub (May 20, 2020): Cool!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BOOTSTRA.386#79