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

Disable liga+calt option for fontbuilder #33

Closed chase closed 9 years ago

chase commented 9 years ago

Some research:

font.gsub_lookups =

("'liga' Standard Ligatures lookup 0", "'calt' Contextual Alternates lookup 1", 'Single Substitution lookup 2', 'Single Substitution lookup 3', 'Single Substitution lookup 4', 'Single Substitution lookup 5', 'Single Substitution lookup 6', 'Single Substitution lookup 7', 'Single Substitution lookup 8', 'Single Substitution lookup 9', 'Single Substitution lookup 10', 'Single Substitution lookup 11', 'Single Substitution lookup 12', 'Single Substitution lookup 13', 'Single Substitution lookup 14', 'Single Substitution lookup 15', 'Single Substitution lookup 16', 'Single Substitution lookup 17', 'Single Substitution lookup 18', 'Single Substitution lookup 19', 'Single Substitution lookup 20', 'Single Substitution lookup 21', 'Single Substitution lookup 22', 'Single Substitution lookup 23', 'Single Substitution lookup 24', 'Single Substitution lookup 25', 'Single Substitution lookup 26', 'Single Substitution lookup 27', 'Single Substitution lookup 28', 'Single Substitution lookup 29', 'Single Substitution lookup 30', 'Single Substitution lookup 31', 'Single Substitution lookup 32', 'Single Substitution lookup 33', 'Single Substitution lookup 34', 'Single Substitution lookup 35', 'Single Substitution lookup 36', 'Single Substitution lookup 37', 'Single Substitution lookup 38', 'Single Substitution lookup 39', 'Single Substitution lookup 40', 'Single Substitution lookup 41', 'Single Substitution lookup 42', 'Single Substitution lookup 43', 'Single Substitution lookup 44', 'Single Substitution lookup 45', 'Single Substitution lookup 46', 'Single Substitution lookup 47', 'Single Substitution lookup 48', 'Single Substitution lookup 49', 'Single Substitution lookup 50', 'Single Substitution lookup 51', "'ss01' Style Set 1 lookup 52", "'ss02' Style Set 2 lookup 53", "'ss03' Style Set 3 lookup 54", "'ss10' Style Set 10 lookup 55", "'ss11' Style Set 11 lookup 56", "'ss12' Style Set 12 lookup 57", "'ss13' Style Set 13 lookup 58", "'ss14' Style Set 14 lookup 59", "'ss15' Style Set 15 lookup 60", "'ss16' Style Set 16 lookup 61")

font.getLookupInfo to get tuple with type (first tuple item). Iterate lookup table checking for 'gsub_ligature', 'gsub_contextchain'

font.removeLookup to remove item by name passed to getLookupInfo.

larsenwork commented 9 years ago

I think it's enough just to remove the liga + calt Single substitution ones are only called through liga and calt (if you look in font.props you can see that the single substitution ones have no script/language specified)

chase commented 9 years ago

Right, gsub_lookups just lists all possible lookups. There isn't a real way to query it, so I have to chug through all of them to try and find gsub_ligature and gsub_contextchain to remove liga and calt sublookups.

larsenwork commented 9 years ago

Ok, wait a bit doing anything as I'll see if can use just calt and that might solve the issue.

chase commented 9 years ago

I think adding this as an option is a good idea either way, because I personally would prefer to see "<= over ≤" in my code simply due to trained recognition.

larsenwork commented 9 years ago

Yep, but no reason for doing so in the build scripts because if everything is contextual alternates then you'll have to actively enable "calt" in your editors for it to appear.

larsenwork commented 9 years ago

i think...

chase commented 9 years ago

Unfortunately, Linux users are stuck with xft which renders pretty much every font everywhere. Hardly anyone bypasses font rendering options, since font rendering is already a difficult problem handled by xft. Given that xft doesn't support disabling contextual alternates, this means that one can't simply disable contextual alternates or ligatures.

This commonly leads to Linux-specific forks for fonts that ligatures, like Monaco: https://gist.github.com/epegzz/1634235

larsenwork commented 9 years ago

Ah...I'm not a linux guy :)

larsenwork commented 9 years ago

I've disabled it in source until we get it sorted out :)

chase commented 9 years ago

I'll have this ready tomorrow and everything should be good to go before the 25th :+1:

larsenwork commented 9 years ago

Perfect - not critical though so don't :sweat_smile:

The whole concept is still quite experimental in terms of editor support.

larsenwork commented 9 years ago

does the disable thing work now?

chase commented 9 years ago

Nope, didn't implement that yet. Will get around to that next weekend.

larsenwork commented 9 years ago

No stress, just curious :smile:

glebd commented 9 years ago

Just wanted to say -- excellent font, really shaping up to be the best programming font. Looking forward to having ligatures again -- Monoid was the only font with ligatures that worked in OS X Terminal and Xcode. Thank you for your work, truly well done.

larsenwork commented 9 years ago

@glebd cheers, ligatures will reappear for sure - any ideas/suggestions about ligatures are much welcomed in #25 :+1: