8

I created a font with icomoon

and I wanted to use ligatures. Currently all my ligatures have hyphens in the ligature code. For example: my-ligature

enter image description here

So when I use

<i>my-ligature</i>

It works as expected in Firefox and IE but not Chrome. When I add a &nbsp; or any other character like

<i>my-ligature&nbsp;</i>
<i>my-ligature </li>

It also works in Chrome.

As soon as I replace the hyphen in the ligature code with something else like an underscore it works in Chrome as expected (no whitespace etc. necessary)

Is this a Chrome Bug or are hyphens not allowed here?

You'll find a demo of the whole thing here (made with a standard icomoon icon) http://www.swisscocktailblog.ch/icomoon/demo.html

EDIT: As requested the css for the ligatures (it's the one used in the demo)

@font-face {
    font-family: 'icomoon';
    src:url('fonts/icomoon.eot?6mfq3a');
    src:url('fonts/icomoon.eot?#iefix6mfq3a') format('embedded-opentype'),
    url('fonts/icomoon.ttf?6mfq3a') format('truetype'),
    url('fonts/icomoon.woff?6mfq3a') format('woff'),
    url('fonts/icomoon.svg?6mfq3a#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}

i, .icomoon-liga {
    font-family: 'icomoon';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Enable Ligatures ================ */
    letter-spacing: 0;
    -webkit-font-feature-settings: "liga";
    -moz-font-feature-settings: "liga=1";
    -moz-font-feature-settings: "liga";
    -ms-font-feature-settings: "liga" 1;
    -o-font-feature-settings: "liga";
    font-feature-settings: "liga";

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-wifi-full:before {
    content: "\e600";
}
Arikael
  • 1,989
  • 1
  • 23
  • 60
  • I added the code in my question above – Arikael Jul 31 '15 at 08:33
  • would it also be possible for you to run your font through TTX to show that its GSUB ligature information makes sense? (i.e. kicks in for the word you need, rather than for the word you need + some character?) – Mike 'Pomax' Kamermans Jul 31 '15 at 15:59
  • Any luck with this? – Fez Vrasta Oct 31 '16 at 16:31
  • I see that even the iconic font of Google uses underscores and not dashes... same reason? – Fez Vrasta Oct 31 '16 at 18:49