Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing glyph"-sign is shown for line feed in IE11 #176

Open
RoelN opened this issue Feb 3, 2014 · 1 comment
Open

"Missing glyph"-sign is shown for line feed in IE11 #176

RoelN opened this issue Feb 3, 2014 · 1 comment
Labels
Milestone

Comments

@RoelN
Copy link
Contributor

RoelN commented Feb 3, 2014

If I create a font with fontcustom, line feeds are showing a "missing glyph"-symbol in Internet Explorer 11. These will be an actual new line, but the previous line will show a rectangle.

You can reproduce this quickly by going to the http://fontcustom.com/ website and editing the :before content with the F12-tools. If you take the first icon you should change

.icon-browser:before {
    content: "\f100";
}

to

.icon-browser:before {
    content: "\f100 \a test";
    white-space: pre;
}

to see the effect. Here's a screenshot of what will happen in IE11:

ie11icon

Other browsers are fine. I checked the glyf table and 0x0a is mapped to .notdef, which is the same for other (icon) fonts. But the rectangle only shows up for fonts created with fontcustom.

@RoelN
Copy link
Contributor Author

RoelN commented Feb 5, 2014

Ok, the problem is with the fact that no glyph for 0x20 (space) has been defined. The problem can also be reproduced when you use a space in the icon container.

I fixed it manually for my font. First I tried adding it to .fontcustom-manifest.json and mapping space to an empty SVG, but this caused some misalignment with my other glyphs.

So I started editing the TTF with TTX/FontTools and removed all unused charcters:

<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name=".null"/>
<GlyphID id="2" name="nonmarkingreturn"/>
<GlyphID id="3" name="hyphen"/>

I removed them from the hmtx, cmap and glyf tables as well, and added added the space character there.

The glyph for the space character I used:

<TTGlyph name="space" xMin="0" yMin="0" xMax="0" yMax="0">
  <contour>
    <pt x="0" y="0" on="1"/>
    <pt x="0" y="0" on="1"/>
    <pt x="0" y="0" on="1"/>
  </contour>
  <instructions><assembly>
    </assembly></instructions>
</TTGlyph>

Turning this back into a TTF font results in a proper font.

Proposed solution for fontcustom: add this space char by default.

@kaizau kaizau added this to the 1.3.5 milestone Feb 8, 2014
@kaizau kaizau added the bug label Feb 8, 2014
kaizau added a commit that referenced this issue Feb 2, 2015
Add valid space glyph to avoid issues on IE11, this fixes issue #176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants