4 ms·
I have enjoyed perusing this in the past, but when I see the word "typographer" split across two lines as "ty" and "pographer" [1] in the first paragraph of the
by gnicholas 6y ago
I have enjoyed perusing this in the past, but when I see the word "typographer" split across two lines as "ty" and "pographer" [1] in the first paragraph of the "Typography in ten minutes" page, [2] it gives me pause. What is the point of having two letters (especially these two, which do not form a morpheme) on the first line?
I find this to impair readability and not to enhance aesthetics in any meaningful way. Is there something I'm missing?
1: https://imgur.com/P0trcqu https://imgur.com/P0trcqu
2: https://practicaltypography.com/typography-in-ten-minutes.html https://practicaltypography.com/typography-in-ten-minutes.ht...
- mohn 6y ago> What is the point That is not a deliberate choice, but an unfortunate artifact of setting the content div to have a maximum width of 652 pixels. If you reduce the width of your browser, the word "better" will be split instead. If you reduce it further, the line wrapping is achieved without splitting any words in that paragraph.
- gnicholas 6y agoI assumed it was some sort of algorithmic choice to allow hyphenation that leaves only two characters on one line. I would set the threshold for this to be greater than 2, assuming no other 'intelligence' is used. For example, it could be OK in some circumstances, in the case of the word "irredeemable". But even there, I think it would be jarring to see "ir" at the end of a line, and I would rather just have the whole word on the next line. But then I'm a crazy fellow who thinks that this [1] is a good idea for enhancing readability. 1: https://chrome.google.com/webstore/detail/beeline-reader/ifjafammaookpiajfbedmacfldaiamgg?hl=en https://chrome.google.com/webstore/detail/beeline-reader/ifj...
- epse 6y agoHe has written and uses (at least for the last edition) a Racket library / language for this book that also automatically adds unicode soft hyphens where appropriate in words, so I assume this is one of them
- gnicholas 6y agoHow does it decide where is appropriate? Is it based on the length of the potential fragments, the length of the word, some sort of ratio, or something else? I'd rather have a hyphenation algorithm err on the side of fewer hyphenations, but perhaps that's just me. My understanding is that a ragged right edge can improve visual tracking ability because it makes the paragraph less visually uniform. No one wants things to be too ragged, but in this case two chars doesn't seem like it's worth the tradeoff.
- RobertKerans 6y agoUses Knuth/Liang hyphenation algorithm, which prioritises prevention of incorrect hyphens over perfect output (which is not practical -- dictionary size has to be limited). It's never going to be completely correct, the trade-off for having a few weird hyphenations is that overall it's generally ok, and yes, the alternative is ragged right. By default minimum length is two, and I assume the output is using that (haven't checked). Edit: found the overview from the docs -- https://docs.racket-lang.org/hyphenate/index.html https://docs.racket-lang.org/hyphenate/index.html And Liang's thesis (PDF): https://tug.org/docs/liang/liang-thesis.pdf https://tug.org/docs/liang/liang-thesis.pdf Edit edit: from memory (and it's been about 9 years since I last worked in print so a bit foggy), for print it's generally best to set either 2 or 3 as a minimum: 4 is pushing it and tends to cause issues. With print, set using the hyphenation algo then worked forward from the start of the book fixing any spacing issues. With web can't do latter and width is changeable, so there are always going to be issues with justification. I can't imagine any situation where the browser could operate fast enough to render accurately hyphenated text without using a huge amount of resource.
- gwern 6y agoIncidentally, this is no longer necessary. Gwern.net used the same trick but we removed it last week (to much rejoicing). The main reason to auto-add soft hyphens is because, unlike almost all other browsers, desktop Chrome has for decades not supported hyphenation (even though mobile Chrome does!). But they finally shipped support last year, and now market support for hyphenation is around 95%+ according to CanIUse. So you can just drop the soft hyphen pass and rely on normal CSS to specify justification. This is good because it simplifies HTML creation, makes the HTML noticeably smaller & better compressing, makes it more readable, search/replace more reliable, buggy screen readers no longer pronounce soft hyphens (another real WTF moment for me), doesn't require hacks like the JS copylistener to strip them out... Anyway long story short, if you've been using the soft hyphen trick, I suggest revisiting the decision now.
- JimDabell 6y agoThis seems like browser behaviour not an author choice. It happens for me in Safari but not in Firefox or Chrome. Looking at the DOM, it’s just the whole word, no Unicode characters or CSS that would do this.
- flobosg 6y agoThe words in the text have soft hyphens[1] that allow word breaking. [1]:https://en.wikipedia.org/wiki/Soft_hyphen https://en.wikipedia.org/wiki/Soft_hyphen
- JimDabell 6y agoYou’re right. Wow, that’s annoying – when you copy and paste the value from developer tools in Safari it strips those characters, so you only get the printable characters.
- jjgreen 6y agoThat's the (a) way that TeX would hyphenate it: $ tex This is TeX, Version 3.14159265 (TeX Live 2016) (preloaded format=tex) **\relax *\showhyphens{typographer} Underfull \hbox (badness 10000) detected at line 0 [] \tenrm ty-pog-ra-pher
- gnicholas 6y agoThanks, that’s interesting! So it breaks all of the morphemes? I’d prefer typo-grapher or typograph-er to the above options. I wonder if people who are more or less visual would have different preferences. I’m visual, so perhaps I optimize for the visual appearance of morphemes as opposed to the syllable breaks?
- ilammy 6y ago> So it breaks all of the morphemes? Not really. TeX uses Knuth-Liang algorithm which does not do any morphological or semantical analysis. You basically feed it a corpus of words, it learns substrings that contain word breaks more often, condenses this information, and uses that to guess where an arbitrary word could be hyphenated. In particular, TeX's hyphenation data contains lines y3po 5po4g which strongly suggest that when TeX sees substrings “ypo” and “?pog” they can be hyphenated as “y-po” and “?-pog”. (Odd weights allow hyphenation, even weights discourage it.) That's why “typograher” is hyphenated like that, since it's not in the exception list.
- neolog 6y agoIs there a morpheme-aware version?
- dhosek 6y agoYes, with different patterns it's possible and the en-gb patterns do this (see https://www.tug.org/tex-hyphen/ https://www.tug.org/tex-hyphen/). Morpheme-aware hyphenation does have some oddities, though, like hyphenating helicopter as helico-pter.