adobe-fonts / source-code-pro

Monospaced font family for user interface and coding environments
https://adobe-fonts.github.io/source-code-pro/
SIL Open Font License 1.1
19.74k stars 1.62k forks source link

Cyrillic rendering problem #325

Open jbaublitz opened 8 months ago

jbaublitz commented 8 months ago

Ukrainian Cyrillic letter і with unicode code point u0301 should render as і́. In Source Code Pro, I seem to be getting і ́. I originally thought this was a bug in Gnome font rendering, but it appears to only occur with this font.

Here is the link to the Gnome issue where there was some additional debugging. https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/618

kenmcd commented 8 months ago

Hmmm... I can see what is happening. The acutecomb has a width the same as all the other characters. Normally combining marks have no width (and/or they have anchors for proper alignment). In this case the mark has a width and no anchors. So it just acts like another monospace character.

In Liberation Mono the acutecomb has no width and the contour (the actual shape) is a little to the left of center. When it follows the 0456 it actually overlays that character, and it ends up placed a little to the right of the dot. So it looks OK in Liberation Mono.

I also looked at Cascadia Code and its acutecomb has no width, but it is positioned to the right of center so it also looks bad for this purpose.

In IBM Plex Mono the acutecomb has no width and the shape is close to center, so it looks better too.

JetBrains Mono the acutecomb has no width but it is very far left of center and ends up overlaying the dot.

No sure why this acutecomb mark has a full width, but that is the issue.

Re Ukrainian: my understanding is the acute is used to indicate stress on vowels. Is the acute usually positioned above the dot, or to the right? What is the "correct" placement? Do you have any example fonts which handle this correctly for Ukrainian?

pauldhunt commented 8 months ago

It looks like there are multiple things going on here. The fonts set all of the characters on a 600 unit width so that it registers as a monowidth font on Mac and relies on some OpenType code to collapse the widths, but it seems that some environments are not accessing that code. Additionally, mark placement for Ukrainian stressed vowels doesn’t seem to be supported in the current version of the fonts. Will do some more checking into how to fix this when I pick this project up again.

jbaublitz commented 8 months ago

Okay, thanks for looking into this!

jbaublitz commented 7 months ago

Re Ukrainian: my understanding is the acute is used to indicate stress on vowels. Is the acute usually positioned above the dot, or to the right? What is the "correct" placement? Do you have any example fonts which handle this correctly for Ukrainian?

Hi @kenmcd, I'm sorry, I missed this part. Yes, that is correct. It is only useful for things like dictionaries, etc. that mark word stress or introductory educational materials for non-native speakers. I have never really seen it used outside of cases like that. For an example of a font that renders this correctly, I'm using the font titled "Monospace" on Linux and it seems to render it properly. I've seen some fonts skew a little bit to the right but the ideal placement is centered over the letter. It gets a little bit more complicated with i-like letters (і and ї) because of the dot/dots, which can render like a difficult to read blob in some fonts. As long as it's clear that it's a stress mark as a opposed to a dot for і and [placed above but not covering the dots for ї, that should be good enough. The Wiktionary rendering for this word is actually a great example of how hard it can be to read when it all gets mushed together with the letter ї. The "Monospace" font that I mentioned before does a great job of handling both of these cases if you need an example. Here's a screen shot for both of these letters in that font.

Screenshot from 2023-11-28 17-13-31

kenmcd commented 7 months ago

@jbaublitz Thanks for the info. Not sure how this will work "correctly" for a monospaced font. But, I do now know exactly what I need to do in my proportional text font to properly support Ukrainian. I also found some other info on the proper stress marks. Thanks.

jbaublitz commented 7 months ago

The screenshot is from a monospace font, so it seems doable though I would have no idea where to begin, not being a font person.

kenmcd commented 7 months ago

I found a version of Monospace font by George Williams. And it does have zero width acutecomb (and other comb marks). But the Cyrillic і does not have any anchors, so it does not work. Perhaps you have a different updated version of the font. It does have an OFL-SIL license so you could attach it here. Be interested in seeing what is in there.

moyogo commented 7 months ago

@kenmcd Substitute the dotted i for a dotless one when combined with a top accent. For example see https://googlefonts.github.io/gf-guide/diacritics.html#soft-dotted-glyphs