Google Font "Atma" doesn't compile to html5

Trying to compile with any variant of the Atma font:
@:font("…/src/com/masque/snackjack/fonts/Atma-Regular.ttf")

Causes the compiler to show errors:
image

This doesn’t happen for the many other google fonts I have used

Did you try to remove the ‘-’ from the name path? Just a guess really. Might be worth experimenting with hxTrueType library to see if there is an error with some of the tables by adding in some traces, often fonts fail because of bad glyphs. You can sometimes use other software to replace them or you can alter the font parser to skip the offending character or limit the range so it’s not included. Many design ttf fonts are incomplete and this can easily trip up font parsers or maybe the glyph has complex compound path that is not fully supported. I suggest hxTrueType as you could use it standalone without a framework dependancy and just debug the font parsing yourself.

Once you know where in the font glyphs, font path or font table the problem is then it will be much easier for someone to patch the code or for you to adjust the ttf file. Fonts are often rather badly made and it’s not really the fault of the parser if the font is not correct, so it’s really up to the user to locate the issue and provide more complete details of the reason for the error especially when it’s opensource code as dev time is likely limited.

You can also manually add fonts to your HTML page and reference the font name using the CSS name you used to embed it

1 Like

Thanks @singmajesty, I’d been wondering about this very thing, figuring it would probably be more efficient for the user to grab it from Google and ideally their own cache if it’s a font they’ve already loaded from Google previously.