larsenwork / monoid

Customisable coding font with alternates, ligatures and contextual positioning. Crazy crisp at 12px/9pt. http://larsenwork.com/monoid/
7.86k stars 170 forks source link

Cyrillic support #7

Closed larsenwork closed 9 years ago

larsenwork commented 9 years ago

First try available now in 0.24. This is what I have so far.

screen shot 2015-04-06 at 17 29 59

What I need is

*The best I've found is PT Sans but this requires a different 3 - does coding programs generally "know" you're writing e.g. Russian so I could use language based substitution?

PT Sans screen shot 2015-04-06 at 15 58 50

K900 commented 9 years ago

This is З (the letter), Э and 3 (the number) in Consolas: DejaVu Sans Mono: Liberation Mono: Courier New: Fira Mono:

K900 commented 9 years ago

Some general observations: Э is always a single curve, so the main problem is capital З versus 3. Most fonts seem to make the letter wider than the number.

DejaVu is absolutely terrible:

Liberation is better:

Consolas is bad:

Fira is second best:

Courier New wins by being serif:

K900 commented 9 years ago

More testing: PT Mono, a Russian developed font, extremely good:

Ubuntu Mono - DejaVu ripoff?

Inconsolata - OK:

larsenwork commented 9 years ago

@K900 thank you, great that we both agree on PT (mono/sans) being the best option. I will not change the default letter 3 in the font so it has to be a stylistic alternate (as e.g. slashed zero is now) or, even better, language based substitution.

I will try to make the latter and upload for you to test in your terminal/coding program and if it doesn't work the use the stylistic alternate.

larsenwork commented 9 years ago

screen shot 2015-04-06 at 17 53 00

I just pushed 0.24 with cyrillic support for Mono16 Normal - could you test?

I should change the default 3 to the pictures version when it detects cyrillic script.

I've used: Localized Forms locl S1 Substitutes character with the preferred form based on script language

K900 commented 9 years ago

Wow, it's pretty crazy that fonts even get to do that. I wonder how to preserve consistency between code (i.e. English) and Russian text though...

K900 commented 9 years ago

...aaaand Sublime entirely ignores the hints.

larsenwork commented 9 years ago

locl usually works by following the application and/or document settings but obviously the program has to support it which sublime apparently doesn't :/

Locl doesn't change the letter so it doesn't affect code - it just changes how the letter is shown if the font and the program supports it.

I won't remove the locl as it's nice to have for e.g. web use but I'll add is as stylistic alternate too.

Any other thoughts on the design?

larsenwork commented 9 years ago

Latest upload includes 3 as style set 2 - just follow this guide: https://github.com/andreaslarsen/mono16/blob/master/Resources/Readme.pdf

larsenwork commented 9 years ago

screen shot 2015-04-06 at 20 33 57

5 3 E ZE

larsenwork commented 9 years ago

Added a cyrillic pdf https://github.com/andreaslarsen/mono16/blob/master/Resources/Testing/Mono16cyrillic.pdf

I'm particularly unsure about "EF" "DE" and "SHCHA"

K900 commented 9 years ago

Looking at it now: lower case ф doesn't have to be that tall, Д is fine, Щ usually has the lower right tick thing moved a bit to the right of the Ш part, you should be able to see it here on GitHub.

K900 commented 9 years ago

Also, б's top part might be a bit too straight of a line, it kind of looks like 6 now.

larsenwork commented 9 years ago

Щ: It's a space issue...not sure how I can draw it otherwise: screen shot 2015-04-07 at 12 17 31

I have updated б and ф too, better or? https://github.com/andreaslarsen/mono16/blob/master/Resources/Testing/Mono16cyrillic.pdf

K900 commented 9 years ago

б is nice now, not sure about ф - it looks like most fonts let the vertical line drop a bit below the baseline. Here's PT Mono: . About Щ: maybe make the Ш part narrower?

larsenwork commented 9 years ago

So more like this? screen shot 2015-04-07 at 13 24 51 screen shot 2015-04-07 at 13 25 20

larsenwork commented 9 years ago

Щ: problem is I have to stick to the grid and that would make it very narrow.

Current: screen shot 2015-04-07 at 13 24 23

K900 commented 9 years ago

Yeah, something like that probably. It doesn't really have to be the same height as the "d", but that's up to you. And yeah, not really sure what to do about Щ. You can't go any wider than that, right?

larsenwork commented 9 years ago

I can maybe go wider but that depends on which letters usually come after Щ ?

K900 commented 9 years ago

According to this, bigrams that start with Щ, sorted by frequency:

ЩЕ 397624 ЩИ 280738 ЩА 121761 ЩЁ 40078 ЩН 21884 ЩУ 18341 ЩЬ 17426 ЩР 1289 ЩО 687 ЩВ 462 ЩП 326 ЩС 265 ЩК 157 ЩМ 152 ЩД 110 ЩЯ 103 ЩБ 102 ЩТ 99 ЩГ 71 ЩЛ 62 ЩЗ 57 ЩФ 35 ЩЧ 34 ЩЩ 32 ЩЮ 30 ЩЭ 28 ЩШ 26 ЩХ 26 ЩЙ 25 ЩЦ 15 ЩЖ 14 ЩЫ 11 ЩЪ 1

Not sure what their methodology was, but this looks more or less correct at a quick glance.

larsenwork commented 9 years ago

great find! We could get away with it if we assume people don't write that much ALL CAPS in Russian in code... Only мд are really problematic and they aren't that common.

screen shot 2015-04-07 at 13 55 10

larsenwork commented 9 years ago

screen shot 2015-04-07 at 13 58 22

K900 commented 9 years ago

I'm pretty sure ЩМ/ЩД is only ever used in abbreviations. Also, ЩД is actually broken even in Arial or whatever it is GitHub uses. The new Щ is definitely a lot better. Now that I notice it though: why are E and Ё different in height? That looks kind of weird.

larsenwork commented 9 years ago

We'll keep it like this then. The Ё looks weird but it and all other capitals with diacritics are "squeezed" to preserve the whitespace between the lines which is important when using small line heights like this:

screen shot 2015-04-07 at 13 10 40

larsenwork commented 9 years ago

I've now pushed 2.5 for normal with all the adjustments we've talked about here + I made Capital DE a little wider to the left.

larsenwork commented 9 years ago

It would be great if you could find some code samples where cyrillics are also used :) (for the website)

chase commented 9 years ago

At least in my experience, most code is written in English and occasionally the comments are written in a shared or native language of the developers. You could always use the pangram that Gnome uses: В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!

larsenwork commented 9 years ago

Ending up finding some russian code myself (and czech and french) so think we're covered now - but I'll probably add a pangrams page too - good idea!