5 ms·
I’ve been tending towards the opinion that features like this are a bad idea: that we might be better served by a general “this is prose” signal that triggers t
by chrismorgan 3y ago
I’ve been tending towards the opinion that features like this are a bad idea: that we might be better served by a general “this is prose” signal that triggers things like Knuth-Plass line-breaking, partially-hung punctuation (not full, please not full, it’s awful), conservative hyphenation, maybe even spacing and stretching tweaks to reduce the need of hyphenation (like the CTAN microtype package provides), whatever else the user agent supports. Bundle it all up in an all/auto/none property that defaults to auto, and let browsers choose heuristics for normal content. (OK, so I wouldn’t limit it quite that hard, I’d make it a little more like font-variant, but I do believe the default should be heuristic-based rather than disabled.)
- globular-toast 3y agoI agree. On my e-reader I can choose to enable hanging punctuation. Why should a web developer be able to or be expected to make that choice for me?
- lwhi 3y agoA web developer shouldn't, but a designer should. Otherwise, why bother with design?
- marginalia_nu 3y agoHow would you distinguish between web design and development?
- lwhi 3y agoHow it's built vs what it looks like.
- marginalia_nu 3y agoThat's arguably a very limited view of design. Design is far more than aesthetics.
- lwhi 3y agoDesign is visual engineering .. development is software engineering. Both essentially involve solving problems.
- marginalia_nu 3y agoI don't think this agrees with how the term is used. I've never heard of anyone being said to design a painting or a sculpture. Meanwhile, engineers are said to design things that aren't visible, such as algorithms or a circuits.
- lwhi 3y agoWe're talking about web design. If we consider art .. sculpture and painting do require planning, preparatory sketches or a maquette. Design thinking allows us to build and solve.
- marginalia_nu 3y agoI don't see any obvious reason why design should come to mean pure aesthetics in this particular domain, and even if we do, what word is left to mean actual design work in the traditional sense of the word?
- lwhi 3y agoIt doesn't mean pure aesthetics .. the way something looks affects it's affordance.
- charcircuit 3y agoFor the same reason a web page can choose what font to use even of your ereader has a feature to change fonts.
- Sharlin 3y agoWhy should the typesetter of a dead-tree book be able or be expected to make that choice for me?
- neoberg 3y agoBecause it's impossible while it's not in the digital medium?
- tannhaeuser 3y agoDon't tell the CSS zealots, but mainstream eBook readers (for the XHTML-based EPUB) basically throw the CSS away and reflow everything anyway based on a generic prose style with a heavily optimized serif and user preferences for font size. Most importantly, they're applying proper hyphenation and justification, as expected by book readers and unsupported by CSS for a much better reading experience compared to browsers. The extent of this might not be readily apparent in English language publications (with relatively short words and long phrases), but in German almost every other line has hyphenated words at the end (and I'm guessing in other languages with long composed words such as Finnish or Hungarian as well). EPUB uses extra tags for eg. spreading (responsive layout) anyway. Reading EPUB 3 specs is almost comical when compared with the feature set of real world EPUB publications and reader software: CSS trickery (such as pointless SVG wrappers around raster images), yet not using floated elements even for the few cases where it's a good fit (initials, flowed images), using Unicode quotations and mdash/ndash, not using CSS paged media for pagination and line numbering, EPUB 3 reference examples crashing reader software, Amazon and Apple using proprietary EPUB extensions for these reasons anyway (and having good technical reason to) while not contributing to W3C, Inc's spec., ... The last useful EPUB spec version appears to be 3.0. from 2014 before IDPF merged into W3C, Inc. Later versions reference the "HTML living standard" and CSS snapshots (with CSS-everything that no reader software is going to support, ever). To bring old reference examples into compliance with 3.3/epubcheck, the only thing the WG bothered to do was to put secondary headings into <p> elements where they used <h2> in <hgroup> to match the changed spec (removal of the so-called HTML outlining algorithm). Great so this makes the reference examples nominally conformant, but leaves the installed base of eBooks out there without backward compatibility (and e-readers are far from evergreen browsers). Not that it matters anyway: calibre's conversion manpage strongly recommends and defaults to EPUB 2 anyway, supporting EPUB 3 only since 2019. In a way, EPUB 3.3 with its generic forward compat reads like the last spec its authors intend to publish, before the major organizational and funding changes at W3C, Inc in 2023. I'm seriously beginning to wonder if PDF is the better format for reading and archival after all as 7+ inch reading devices become the norm (or don't they?)
- chrismorgan 3y ago> as […] unsupported by CSS Actually, slap `hyphens: auto` onto the CSS (since its default value is `manual`), and whatever your ebook reader does for things like hyphenation and justification is almost certainly spec-compliant, because all of that stuff is explicitly UA-defined these days.
- jahewson 3y agoBut then you lose backwards compatibility and have no standard spec.
- chrismorgan 3y agoThe compatibility hazard is negligible; hanging punctuation is the main one that can actually cause harm if misapplied, and conservative heuristics for enabling it are easily arrived at. You might be surprised at how little of browsers’ existing functionality in these areas is actually defined, or in progressive cases how much is defined as being up to the browser. When I mention things like Knuth-Plass: all current browsers use a greedy first-fit line-breaking algorithm, but IE actually had something better long ago in some situation (I forget), and until recently, the entire thing was simply undefined. Now, the default is declared to be UA-defined (text-wrap-style: auto) <https://www.w3.org/TR/css-text-4/#text-wrap-style https://www.w3.org/TR/css-text-4/#text-wrap-style> with the option to declare a preference for alternative modes like stable, balanced or pretty. Long before this, Firefox had a bug open about implementing Knuth-Plass or similar <https://bugzilla.mozilla.org/show_bug.cgi?id=630181 https://bugzilla.mozilla.org/show_bug.cgi?id=630181>, and the only oppositions have been on technical implementation grounds, not that there’s anything wrong with the concept, which people generally agree is desirable. As regards heuristics, you can define the heuristics to use completely, or you can leave it to browsers with some suggestions, or you can leave it to browsers. There’s plenty of precedent for all three of these.
- epeus 3y agoThe Microsoft trigger was `text-justify: newspaper` and intended for fully-justified narrow columns. I don't think it made it to Edge.
- WorldMaker 3y agoI believe it made it to Spartan Edge but not the switch to Chromium Edge.
- gwern 3y ago> hanging punctuation is the main one that can actually cause harm if misapplied Yeah, it can screw with layout. We recently removed it because it had seemed harmless to have it enabled so Safari users could enjoy it and other browsers would just ignore it, but then we discovered it was screwing up the layout on the main page's lists (https://gwern.net/index https://gwern.net/index) and was not harmless after all. :(
- qaisjp 3y agoInteresting opinion. Why?
- chrismorgan 3y agoIf these things are a good idea, they should be applied generally. Depending on individual sites to apply them, and individually at that, means that most sites will never get them, and that the “best practice” has an ever-increasing weight and burden over time.
- chilmers 3y agoThe problem is, changes to the web platform need to be backward compatible. You can't make a global change without potentially breaking existing content. In this case, you could easily end up triggering scrolling in a bunch of places, or with punctuation being invisible or looking bad. So it has to be opt-in.
- chrismorgan 3y agoRefer to my response to jahewson. You can easily apply this to the vast majority of content with negligible hazard.
- p4bl0 3y agoThe thing is, we cannot think of CSS being just for the browser anymore. More and more stuff are being typesetted or presented/designed using CSS: mobile and desktop applications UI, graphic design (the SVG vector format standard uses CSS), as well as all sorts of printed materials. Whether this is a good idea or not is another question, but it's a fact. So CSS kind of has to offer fine-tuned control over many things including tiny details. See for example Paged.js [1], a way to use HTML and CSS to produce printed books, with complete control over the rendering and an attention to details almost of TeX level's. Using web technologies as source format tremendously facilitates the production of various electronic formats in addition to the printed/PDF version, such as ePub and well, web pages, which need free flow text that print-oriented format do not allow for obvious reasons. All this to say, I agree with your feeling if we stick to web browsers, but CSS is so much more nowadays. [1] https://pagedjs.org/ https://pagedjs.org/
- chrismorgan 3y agoCSS specs are explicitly not interested in prescribing TeX-level control; text-wrap-style is a good example of this: it’s just hints, with the actual algorithms completely UA-defined. And in fact, they’re going out of their way to recommend including multiple distinct heuristics of prettiness, so that developers don’t use it as a proxy for just one thing and start relying on something that is explicitly and deliberately undefined. <https://github.com/w3ctag/design-reviews/issues/864#issuecomment-1655290020 https://github.com/w3ctag/design-reviews/issues/864#issuecom...> (And Chromium has done just this: <https://bugs.chromium.org/p/chromium/issues/detail?id=1432798#c54 https://bugs.chromium.org/p/chromium/issues/detail?id=143279...>.) In other words: you’ve already lost!
- p4bl0 3y agoI understand this, but let's be more concrete: when you use CSS to design for print (that is, in general, to produce a PDF), you are using a specific implementation (e.g., Firefox will be used to produce the final PDF from your HTML and CSS, or Inkscape will be from your SVG and CSS). Given an implementation, you get a determined rendering, and it is this specific one that you need to be able to tweak to your needs. Same goes for application UI design: a given GUI framework comes with its own implementation of CSS rendering and it is its specific output that developers (or rather, theme designers) need to be able to have precise control over. In both cases, even if the standard does not precisely states what property values must give what rendering, you get something using the tools you have and you may want to tweak details to your taste using those same tools (even if only by trial and "error", but for that you need the option to fine tune the properties you want to play with). Again, I'm not saying CSS is coherent nor that this is a good thing in the absolute sense, as I already said, I agree with your feeling, I'm just saying that I understand where the need of more precise control/tweaking over details that is sometime in the standard comes from.
- uxp8u61q 3y agoThe "prose" signal exists, it's called the <p> HTML tag.
- marginalia_nu 3y agoThat's p as in paragraph. <p> also has some honestly pretty weird end-tag omission rules that makes it very unsuitable for any other semantic than demarcating a paragraph.
- uxp8u61q 3y agoA paragraph... of what? Just think about it for a minute...
- marginalia_nu 3y agoOf any sort of text, including but not limited to prose.
- uxp8u61q 3y agoI don't know what you call "prose", but something that needs to be split into paragraphs is called prose in my book. Maybe you've been misusing the <p> tag? Can you describe a situation where you've used the <p> tag that wasn't "prose"?
- marginalia_nu 3y agoAnything on verse for one.
- uxp8u61q 3y agoThat's a joke, right?
- Someone 3y ago> a general “this is prose” signal that triggers things like […] conservative hyphenation At the least, that requires specifying the language of the text, probably even subtle differences such as those between UK and US english (although those can probably be handled very conservatively most of the time, as long words are fairly rare in English, compared to, say, Dutch or German)
- chrismorgan 3y ago`hyphens: auto` is already language-aware. (It’s just that currently it either does nothing or too much, because the first-fit line breaking algorithm is lousy for hyphenation.)
- westurner 3y agoIs there a CSS setting for links not wrapping and instead being justified to a new line on Android devices? Input: - URL1 - URL2 - https://longurl3 Output: - URL1 - URL2 - https://longurl3