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.11k stars 796 forks source link

Text shifts upwards when a non-ASCII character is added #675

Open JNLlB opened 1 year ago

JNLlB commented 1 year ago

Cascadia family version

2106.017

Cascadia family variant(s)

Cascadia Mono (the version without ligatures)

Font file format(s)

Windows Terminal included version (TTF (variable))

Platform

Windows 11 21H2

Other Software

Microsoft 365

What happened?

This happens in Excel 365, but may happen elsewhere. When a character from beyond the ASCII gamut (>0x7F) is used in a string, the whole of the text is displaced upwards by a few pixels. Rudimentary measurements on this 1920 x 1080 screen scaled to 125% suggest that the displacement is 29% of the font's x-height using 36pt type.

image

I have not done any detailed experimentation, but the effect is noticeable at all font sizes. The workaround I've had to resort to is to use at least one non-breaking space (0xA0) before, within or after a string to ensure that text - e.g. in column headings - is aligned. This is illustrated by the middle cell in the screenshot.