tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
77.33k stars 3.1k forks source link

What feature in CSS to enable for === and ---> ligature #508

Closed husnulhamidiah closed 7 years ago

husnulhamidiah commented 7 years ago

I try to use this font along with this extension — custom css and js loader

AFAIK, I have to set font-feature-settings in CSS file to enable ligature. The problem is I can't get some ligature like === or --> to work. Even I use all available feature like below.

* {
    font-feature-settings: "aalt", "abvf", "abvm", "abvs", "afrc", "akhn", "blwf", "blwm", "blws", "calt", "case", "ccmp", "cfar", "cjct", "clig", "cpct", "cpsp", "cswh", "curs", "c2pc", "c2sc", "dist", "dlig", "dnom", "dtls", "expt", "falt", "fin2", "fin3", "fina", "flac", "frac", "fwid", "half", "haln", "halt", "hist", "hkna", "hlig", "hngl", "hojo", "hwid", "init", "isol", "ital", "jalt", "jp78", "jp83", "jp90", "jp04", "kern", "lfbd", "liga", "ljmo", "lnum", "locl", "ltra", "ltrm", "mark", "med2", "medi", "mgrk", "mkmk", "mset", "nalt", "nlck", "nukt", "numr", "onum", "opbd", "ordn", "ornm", "palt", "pcap", "pkna", "pnum", "pref", "pres", "pstf", "psts", "pwid", "qwid", "rand", "rclt", "rkrf", "rlig", "rphf", "rtbd", "rtla", "rtlm", "ruby", "rvrn", "salt", "sinf", "size", "smcp", "smpl", "ss01", "ss02", "ss03", "ss04", "ss05", "ss06", "ss07", "ss08", "ss09", "ss10", "ss11", "ss12", "ss13", "ss14", "ss15", "ss16", "ss17", "ss18", "ss19", "ss20", "ssty", "stch", "subs", "sups", "swsh", "titl", "tjmo", "tnam", "tnum", "trad", "twid", "unic", "valt", "vatu", "vert", "vhal", "vjmo", "vkna", "vkrn", "vpal", "vrt2", "vrtr", "zero";
    -webkit-font-feature-settings: "aalt", "abvf", "abvm", "abvs", "afrc", "akhn", "blwf", "blwm", "blws", "calt", "case", "ccmp", "cfar", "cjct", "clig", "cpct", "cpsp", "cswh", "curs", "c2pc", "c2sc", "dist", "dlig", "dnom", "dtls", "expt", "falt", "fin2", "fin3", "fina", "flac", "frac", "fwid", "half", "haln", "halt", "hist", "hkna", "hlig", "hngl", "hojo", "hwid", "init", "isol", "ital", "jalt", "jp78", "jp83", "jp90", "jp04", "kern", "lfbd", "liga", "ljmo", "lnum", "locl", "ltra", "ltrm", "mark", "med2", "medi", "mgrk", "mkmk", "mset", "nalt", "nlck", "nukt", "numr", "onum", "opbd", "ordn", "ornm", "palt", "pcap", "pkna", "pnum", "pref", "pres", "pstf", "psts", "pwid", "qwid", "rand", "rclt", "rkrf", "rlig", "rphf", "rtbd", "rtla", "rtlm", "ruby", "rvrn", "salt", "sinf", "size", "smcp", "smpl", "ss01", "ss02", "ss03", "ss04", "ss05", "ss06", "ss07", "ss08", "ss09", "ss10", "ss11", "ss12", "ss13", "ss14", "ss15", "ss16", "ss17", "ss18", "ss19", "ss20", "ssty", "stch", "subs", "sups", "swsh", "titl", "tjmo", "tnam", "tnum", "trad", "twid", "unic", "valt", "vatu", "vert", "vhal", "vjmo", "vkna", "vkrn", "vpal", "vrt2", "vrtr", "zero";
    text-rendering: optimizeLegibility;
}

So anyone know how to solve this? Am I missing something?

tonsky commented 7 years ago

This is a problem with specific syntaxes and how highlighting is implemented in them. See https://github.com/tonsky/FiraCode/wiki#some-ligatures-work-while-some-dont

geyang commented 4 years ago

Problem I ran into was highlight.js broke >= into > and = highlighted separately. This cause the ligature to fail because the two characters are in different colored spans.