bonitasoft / bonita-documentation-theme

Dedicated Antora UI Bundle used to produce the Bonita Documentation
https://bonitasoft.github.io/bonita-documentation-theme/
Mozilla Public License 2.0
4 stars 7 forks source link

Firefox logs a font error in the console #127

Open tbouffard opened 2 years ago

tbouffard commented 2 years ago

Seen with firefox 100 on Ubuntu 20.04

production site

downloadable font: kern: Too large subtable (font-family: "Open Sans" style:normal weight:600 stretch:100 src index:0) source: https://documentation.bonitasoft.com/_/font/OpenSans-Semibold.woff2
downloadable font: Table discarded (font-family: "Open Sans" style:normal weight:600 stretch:100 src index:0) source: https://documentation.bonitasoft.com/_/font/OpenSans-Semibold.woff2

theme preview

downloadable font: kern: Too large subtable (font-family: "Open Sans" style:normal weight:600 stretch:100 src index:0) source: https://bonitasoft-bonita-documentation-theme-build_preview-pr-100.surge.sh/_/font/OpenSans-Semibold.woff2
downloadable font: Table discarded (font-family: "Open Sans" style:normal weight:600 stretch:100 src index:0) source: https://bonitasoft-bonita-documentation-theme-build_preview-pr-100.surge.sh/_/font/OpenSans-Semibold.woff2
jeromecambon commented 2 years ago

Reproduced on MacOS, Firefox 103. No problem on Safari and Chrome. This appears on every page.

jeromecambon commented 2 years ago

After investigation, this is an issue from 2015, the Firefox team issue has been set to "won't fix": https://bugzilla.mozilla.org/show_bug.cgi?id=1185685

Related StackOverflow discussion: https://stackoverflow.com/questions/35206815/font-loading-error-downloadable-font-kern-too-large-subtable-table-discarded

To make it short, it seems the issue is related to Firefox that cannot handle fully some complex Open Sans font, that is not following the OpenType specification (see https://bugzilla.mozilla.org/show_bug.cgi?id=1211993)

It seems downloading the latest Google or fontsquirrel Open Sans fonts could solve the issue, but I don't think we want to update the Antora fonts, it could bring more issue than it solve. See https://fonts.google.com/?query=open+sans and https://www.fontsquirrel.com/fonts/open-sans Moreover, it does not seem to have any impact, and according some people it should be a warining instead of an error.

Surprisingly, checking other we sites using Antora, I don't see the issue... Did we change something related to fonts at some points? https://docs.asciidoctor.org https://docs.hazelcast.com https://docs.mulesoft.com

tbouffard commented 2 years ago

I found the following in the theme repo about the font

In other sites and in the default UI bundles, the font configuration may have change. The AsciiDoctor docs site is very close to the Default UI. In the history of our theme, we are missing some changes: the default UI has been updated in a poc repo. Then the result of the poc served as base for the repo but without keeping the history. This may not be related to the issue, but keep this in mind.

@benjaminParisel is probably more aware of the font topic than me and he may provide a better help.

tbouffard commented 2 years ago

ℹ️ Font management docs for the default UI: https://docs.antora.org/antora-ui-default/add-fonts/

tbouffard commented 2 years ago

⚠️ I have just realize that the site bundle 7.4Mb of fonts! This is huge See #124