Skip to content

Define alternative fonts to "Noto Sans" to support old browsers#171

Open
leocaseiro wants to merge 2 commits intoCoderLine:developfrom
leocaseiro:fix-noto-sans-issue-old-browsers
Open

Define alternative fonts to "Noto Sans" to support old browsers#171
leocaseiro wants to merge 2 commits intoCoderLine:developfrom
leocaseiro:fix-noto-sans-issue-old-browsers

Conversation

@leocaseiro
Copy link
Contributor

Hi @Danielku15,

This PR adds support for any device that doesn't have Noto Sans, or had issues loading it somehow.
For context, here is the reason I raised that PR.

I was having issues loading the alphatab notation on an old laptop, even though the audio was playing fine.
It's an old MacBook Air (maybe 2012) with High Sierra 10.13 32-bit (x86_64), which has an old Chrome 116.0.5845.187 x84_64. Probably the latest they had supported for x86.

chrome-116x86

Anyway, I decided to debug that, and it was an easy fix.
The logs had the following error:

[AlphaTab][Font] [Noto Serif] Loading Failed, rendering cannot start Font not available

noto-sans-error

As a workaround, I installed Noto Sans, and I got the same error for Noto Serif, and weird enough, I might not have installed the correct one, but I got the same error now for Noto Serif.

So instead, I decided to try fixing by adding alternative fonts as a fallback, and now it's working fine 🎉

It might look slightly different on some of the fonts, but it's still very good usage.
See an example here:

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants