microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.76k stars 803 forks source link

[Feature Request] Optional ligatures for periods directly below quotation marks #575

Open nc-z opened 3 years ago

nc-z commented 3 years ago

Description of the new feature/enhancement (with images if possible)

In a discussion on American-style quotation marks (She came around the corner and said, "that was odd.") and British-style (She came around the corner and said, "that was odd".), I found a suggestion to have periods directly displayed beneath single and double quotation marks as in the attached image.

Proposed technical implementation details (optional)

While I imagine most people use Cascadia Code to write code, I enjoy writing in it. Now that I've seen it, I think a ligature like this is the most elegant way of handling quotation mark grammar at the end of sentences. It seems easy enough to draw. I'm assuming it would be optional, so as not to interfere with the display of code.

It would be displayed whenever a period directly follows a quotation mark (if enabled as a stylistic set).

7W4h8

nc-z commented 3 years ago

Now that I've thought further, perhaps this behavior could be default for the left and right quotation marks (eg “”) when followed by a period, but not for regular double quotes to avoid conflict with code?

DHowett commented 3 years ago

This is a clever idea! Unfortunately for it, however, to remain a monospaced font we can't have any ligatures whose widths don't match up with the number of characters composing them. ". still needs to take up two advance widths... which would somewhat defeat the purpose of nestling the period under the quote. @aaronbell can almost certainly explain this better than I can.

aaronbell commented 3 years ago

to remain a monospaced font we can't have any ligatures whose widths don't match up with the number of characters composing them

Wellllll, that's not explicitly true :)

When we think of "monospace" there's actually 3 kinds of "monospace":

Strict Monospace - One character, one space wherein all glyphs in a font must be the same width. This is really only workable for fonts with a minimal character set. Some applications require this, but they're behind the times 😄.

Unicode-compliant Monospace - One character, one glyph, except for characters defined by Unicode as zero width, such as combining marks. Cascadia Code Latin and Cascadia Mono align with this.

Grid-aligned Monospace - All user-entered content aligns with a vertical grid, but one glyph, one space is not necessarily adhered to. Cascadia Code Arabic's special calt features do this.

For example, here two characters are merged into a single width:

Screen Shot 2021-09-20 at 9 15 30 AM

Honestly, I had some concerns with implementing this sort of feature in Cascadia Code Arabic, but felt that the benefit of improved text rendering for the specific requirements of Arabic was more important than absolute adherence to the one glyph, one space rule.

This is all to say that while I like this idea, it would have to live in a stylistic set rather than being default in the font, which is not always supported by applications. Do you know if your chosen writing environment can set that feature?

nc-z commented 3 years ago

@aaronbell, I use VSCode and already use stylistic sets.

Thank you for considering the feature.