swiftfontsglyphunicode-escapes

Glyph not displaying


I imported the Google font NotoMusic-Regular.ttf to my SwiftUI iPhone project and everything was going smoothly until I tried to use the 5-line staff glyph. It renders as the question-box unknown glyph glyph.

Other glyphs work fine - “\u{1D11E}” makes a beautiful treble clef. “\u{1D15F}” is a perfect quarter note, even upside down.

But “\u{1D11A}” gives me nothing!

I’ve loaded the font in FontForge and verified the glyph is there, and tried different ways of specifying the Unicode (e.g., utf-8 bytes) but it just won’t render! I checked to ensure it isn’t a compound that needs a partner and it’s not.

I had thought using the Google font would be the safest option and make customers feel better about letting it install, but all I can think now is to try other fonts.

Is there anything more I can do to debug and fix this?


Solution

  • I did a validation on NotoMusic-Regular.ttf in FontForge and there were so many errors it just became obvious that this font is poorly made.

    Plus, there's a w3.org initiative to standardize music notation fonts and NotoMusic's encoding is completely idiosyncratic given this. Another font, Bravura, is used by leading notation software packages, is open-source and is quite frankly perfectly functional, so I switched to that.

    The solution: use Bravura.otf.