alerque / libertinus

The Libertinus font family
Other
928 stars 57 forks source link

Contextual Alternates against common microtypographic mistakes #455

Open Crissov opened 3 years ago

Crissov commented 3 years ago

Inspired by this tweet, I'm considering a PR to add some calt features.

Eszett

In particular, a lowercase eszett ß among uppercase letters, as often encountered, should use the glyph of the uppercase eszett ẞ uni1E9E. Libertinus already handles this fine for automatic smallcaps.

I inspected calt.fea and it does not yet have a macro for Latin uppercase letters that I could use. ccmp.fea, however, already contains a definition for @capitals, which also has Greek and Cyrillic letters in it. For German, I'd probably only need to consider the subset AZ and Adieresis, Adieresis.alt, Odieresis, Odieresis.alt, Udieresis and Udieresis.alt. (É could occur, but it's very unlikely.)

I would favor if we could have a central place to maintain such lists of glyphs. Perhaps they could even get updated automatically when new characters/glyphs are added to the fonts.

Such collections could also make the substitution rules in sc.fea much simpler.

Colon

When the colon : occurs between digits, should we replace its glyph by the ratio glyph or should we raise its position (as Apple does) or should we leave it alone?

Apostrophe

Should we detect and fix accents ` and ´ being used as apostrophes mistakenly?

We could also offer an opt-in smartypants feature that replaces straight apostrophes ' and quotation marks " by curly ones and the hyphen-minus - (when surrounded by whitespace) by a dash depending on language.

Math symbols

Should asterisk * and x be replaced by the multiplication sign when they occur between digits? The hyphen-minus should then also use the minus glyph when followed by a digit.

SI units

It's possible to identify all possible SI unit symbols (including magnitude prefixes) after a digit (and a space) and force them to be upright in an otherwise italic font. Should Libertinus offer such an automation?

There are some frequent unit symbols like the ones for newton-meter (N·m) and kilowatt-hour (kW·h) that should have a multiplication dot inside. I'm not sure a font feature could add this easily if omitted, or whether it should.

iandoug commented 3 years ago

It's possible to identify all possible SI unit symbols (including magnitude prefixes) after a digit (and a space) a

FWIW, I've noticed in LibreOffice Writer that the spellchecker gets upset if I write "15 m" instead of "15m".

cheers, Ian

khaledhosny commented 3 years ago

In particular, a lowercase eszett ß among uppercase letters, as often encountered, should use the glyph of the uppercase eszett ẞ uni1E9E.

Replacing glyphs for encoded characters with glyphs for other encoded characters is generally frowned upon. In this case you are also disallowing mixed case usage behind the user back in a non-standard way and no direct way to override it. One certainly doesn’t want fonts to change McDonald to MCDonald as text case is not their business.

When the colon : occurs between digits, should we replace its glyph by the ratio glyph or should we raise its position (as Apple does) or should we leave it alone?

Same thing. You also get things like https://github.com/rsms/inter/issues/193 when trying to be too smart.

Should asterisk * and x be replaced by the multiplication sign when they occur between digits?

0x0000

iandoug commented 3 years ago

There are things a font should do, like some ligatures, and things a FONT should not do ... :-)

https://www.thepolitetype.com/

Crissov commented 3 years ago

Eszett is different from other Latin letters, though, because its uppercase form has been added to Unicode rather recently and many people still either don’t know about this or don’t know (or care) how to enter it. The lowercase letter occurs within runs of uppercase letters quite frequently, especially in family names.

The hexadecimal notation with 0x could be handled, but I get your point.

georgd commented 3 years ago

With respect to ß, I agree that in 999.999 ‰ of the cases, between two uc letters it should be uppercased. The only case I could think of where not is a designer's joke mocking bad typography — and that user group surely would know how to prevent such replacement ;)

But as per @khaledhosny you should do the substitution by a copy of ẞ in a new glyph called germandbls.uc or something like that.

iandoug commented 3 years ago

Another one to think about: the ℓ for litres. https://en.wikipedia.org/wiki/Litre#Symbol

But controversial ... we were taught to use ℓ but I see many places use L or l. mL just looks wrong :-) I've seen ℓ and l on packaging here, may be limited by font choices ... and some journals require L.

Most people haven't configured their keyboard to type ℓ easily and would need to use a character picker..

Cheers, Ian

kimmus commented 3 years ago

There are things that fonts should do. And there are things that software (word processors etc.) should do, if they are to be done at all. In my opinion, most of the above falls in the latter category.