News for hackers. Stuff that matters.
Re:Intel One Mono Typeface by spockz on Saturday May 13, 2023 @03:43AM (#35926456)
So then it is the responsibility of the font to make sure that when a ligature that it made available is used that is displayed as two characters wide instead of one?
Re:Intel One Mono Typeface by grzm on Saturday May 13, 2023 @03:57AM (#35926520)
If that's the shape the font designer wants for the ligature glyph, yes. IIRC, Tonsky's Fira code is designed with this in mind (https://github.com/tonsky/FiraCode) (and Butterick specifically points this out)

But maybe it's the intent of the designer to have each glyph have the same width, not each "character", so the glyph LESS-THAN OR EQUAL TO (≤, https://www.compart.com/en/unicode/U+2264) would be the same width as < or =: it's ultimately up to the application/typesetting engine to decide whether or to substitute the character string "<=" as "≤", and to see if the font _has_ that character and how to render it to the screen.

I suppose you could have the typesetting engine choose to somehow read the two characters, note that there's a ligature substitution, and "fit" the ligature glyph into a two-character space (say, padding the glyph or horizontally stretching it), but I doubt that would be very pleasing.

But ultimately what gets displayed is up to the typesetting engine: it can choose to use or not use ligatures; it can choose the spacing between glyphs; whether to "fake" certain styles (such as italics), text justification — all sorts of behavior. Good typesetting is available in many more applications today than it was, say, 25 years ago. There was all kinds of janky behavior going on, both from the engines not using information in the fonts when it was available, and faking it or overriding it as well.