Bug 1761686 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This is a font error. The cmap in the font resource actually maps only *three* PUA characters to glyphs:
```
  <cmap>
    <tableVersion version="0"/>
    <cmap_format_4 platformID="0" platEncID="3" language="0">
      <map code="0xf099" name="twitter"/><!-- ???? -->
      <map code="0xf16d" name="instagram"/><!-- ???? -->
      <map code="0xf2c6" name="telegram"/><!-- ???? -->
    </cmap_format_4>
    <cmap_format_0 platformID="1" platEncID="0" language="0">
    </cmap_format_0>
    <cmap_format_4 platformID="3" platEncID="1" language="0">
      <map code="0xf099" name="twitter"/><!-- ???? -->
      <map code="0xf16d" name="instagram"/><!-- ???? -->
      <map code="0xf2c6" name="telegram"/><!-- ???? -->
    </cmap_format_4>
  </cmap>
```
Those are the three that show up in Firefox.

So where's that github logo coming from? Well, like any OpenType font, in addition to the three "real" glyphs, it contains a `.notdef` glyph (with glyph ID 0), as required by the spec:
```
  <GlyphOrder>
    <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
    <GlyphID id="0" name=".notdef"/>
    <GlyphID id="1" name="instagram"/>
    <GlyphID id="2" name="telegram"/>
    <GlyphID id="3" name="twitter"/>
  </GlyphOrder>
```
It turns out the `.notdef` glyph in this font is actually the github logo! Now, `.notdef` is what you get for characters that are not supported by the font -- unless the application does something else such as font fallback (which we would do if it wasn't a PUA codepoint, where fallback is inherently meaningless) or implements an alternative rendering of unsupported characters (in our case, as synthetic "hexbox" glyphs).

In Chrome, they don't implement hexboxes, they just blast the text through the requested font, and so *any* PUA character (except the three that are explicitly mapped) will end up rendering the font's `.notdef` glyph. You can see this in https://www.tmroyal.com/woff-viewer/ if you view this font and "Filter By Unicode Range", and choose the "Private Use Area" range: it'll be filled with github icons.

My guess is this is a result of a font-subsetting process gone bad, or maybe an attempt to be a little *too* clever about minimizing the font.
This is a font error. The cmap in the font resource actually maps only *three* PUA characters to glyphs:
```
  <cmap>
    <tableVersion version="0"/>
    <cmap_format_4 platformID="0" platEncID="3" language="0">
      <map code="0xf099" name="twitter"/><!-- ???? -->
      <map code="0xf16d" name="instagram"/><!-- ???? -->
      <map code="0xf2c6" name="telegram"/><!-- ???? -->
    </cmap_format_4>
    <cmap_format_0 platformID="1" platEncID="0" language="0">
    </cmap_format_0>
    <cmap_format_4 platformID="3" platEncID="1" language="0">
      <map code="0xf099" name="twitter"/><!-- ???? -->
      <map code="0xf16d" name="instagram"/><!-- ???? -->
      <map code="0xf2c6" name="telegram"/><!-- ???? -->
    </cmap_format_4>
  </cmap>
```
Those are the three that show up in Firefox.

So where's that github logo coming from? Well, like any OpenType font, in addition to the three "real" glyphs, it contains a `.notdef` glyph (with glyph ID 0), as required by the spec:
```
  <GlyphOrder>
    <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
    <GlyphID id="0" name=".notdef"/>
    <GlyphID id="1" name="instagram"/>
    <GlyphID id="2" name="telegram"/>
    <GlyphID id="3" name="twitter"/>
  </GlyphOrder>
```
It turns out the `.notdef` glyph in this font is actually the github logo! Now, `.notdef` is what you get for characters that are not supported by the font -- unless the application does something else such as font fallback (which we would do if it wasn't a PUA codepoint, where fallback is inherently meaningless) or implements an alternative rendering of unsupported characters (in our case, as synthetic "hexbox" glyphs).

In Chrome, they don't implement hexboxes, they just blast the text through the requested font, and so *any* PUA character (except the three that are explicitly mapped) will end up rendering the font's `.notdef` glyph. You can see this in Chrome with https://www.tmroyal.com/woff-viewer/ if you view this font and "Filter By Unicode Range", and choose the "Private Use Area" range: it'll be filled with github icons.

My guess is this is a result of a font-subsetting process gone bad, or maybe an attempt to be a little *too* clever about minimizing the font.

Back to Bug 1761686 Comment 8