Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some users report broken font starting with Gitea 1.14 #15844

Closed
1 task done
fnetX opened this issue May 12, 2021 · 6 comments
Closed
1 task done

Some users report broken font starting with Gitea 1.14 #15844

fnetX opened this issue May 12, 2021 · 6 comments

Comments

@fnetX
Copy link
Contributor

fnetX commented May 12, 2021

Description

Forwarded from Codeberg https://codeberg.org/Codeberg/Community/issues/444 :
Multiple users reported issues with fonts in different browsers where some versions work, some don't. Especially affected are Emojis, two users (one in the issue, another one via Mastodon) reported that numbers were missing in the fonts. Please find the original report at the URL above, additionally I'll copy some relevant information here.

browser Gitea 1.13.6 Gitea 1.14.1
Firefox works works
Tor Browser (not ver 10.0.16) works broken
Ungoogled Chromium works broken

However I noticed that noticed on Tor Browser that numbers don't render. var(--fonts-emoji) as a font on the root element seems to be the culprit.


Tor Browser 10.0.16 works but I heard someone else using TB complain that the symbols were boxes.

If you can, please join the discussion over at Codeberg, since some users don't want to use Microsoft GitHub. Otherwise, I can forward the discussion, but please expect high delay.

Thank you for investigating this.

Screenshots

Screenshot, emojis are only rendered as rectangular boxes

This is what it looks like in Ungoogled Chromium 72.0.3626:

Numbers missing

However I noticed that noticed on Tor Browser that numbers don't render. var(--fonts-emoji) as a font on the root element seems to be the culprit.

@zeripath
Copy link
Contributor

I suspect the issue is that the user does not have an emoji font installed. We previously would provide it as a webfont but it was thought that this was unnecessary.

In most cases downloading and install noto color emoji fonts would fix the problem.

@fnetX
Copy link
Contributor Author

fnetX commented May 13, 2021

Downstream closed as invalid ... Can you still have a look at https://codeberg.org/Codeberg/Community/issues/445 (the missing numbers issue)? Was reported twice and seems much more relevant than missing emoji.

@zeripath
Copy link
Contributor

This just doesn't make any sense - why would non emoji numbers be affected?

I think we need to see a screenshot of an actual issue that is occuring.


If it's just the font rendering issue because the emoji font isn't being provided, well one option for codeberg is to just edit the custom/header.tmpl to include a <style> that adds (I think this is correct - adjust as necessary): (for 1.14.x)

<style>
    @font-face {
     font-family: 'Noto Color Emoji';
     src: url('/NotoColorEmoji.eot'); /* IE9 Compat Modes */
     src: url('/NotoColorEmoji.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('/NotoColorEmoji.woff2') format('woff2'), /* Super Modern Browsers */
       url('/NotoColorEmoji.woff') format('woff'), /* Pretty Modern Browsers */
       url('/NotoColorEmoji.ttf')  format('truetype'), /* Chrome, Safari, Android, iOS */
       url('/NotoColorEmoji.svg#svgFontName') format('svg'); /* Legacy iOS */
    }
</style>

and then add the font files to the public/ directory. (for 1.15.x the urls should be /assets/NotoColorEmoji.* - again I think this is correct.)

@n194
Copy link
Contributor

n194 commented May 13, 2021

This is what it looks like in Ungoogled Chromium 72.0.3626:

The second screenshot is actually from Tor Browser 10.0.16 (based on Mozilla Firefox 78.10.0esr)

@fnetX
Copy link
Contributor Author

fnetX commented May 13, 2021

I put the quotes below the screenshot, sorry for the confusion.
And thank you, @zeripath for stepping in.

zeripath added a commit to zeripath/gitea that referenced this issue May 13, 2021
The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of go-gitea#15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
@fnetX
Copy link
Contributor Author

fnetX commented May 13, 2021

The mentioned pull fixes the most pressing issue with a still supported browser. The other issue is free for further investigation, but only seems to affect outdated Ungoogled Chromium on oldoldstable Debian and only Emoji instead of more-relevant numbers.

@fnetX fnetX closed this as completed May 13, 2021
6543 pushed a commit that referenced this issue May 16, 2021
The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of #15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue May 16, 2021
Backport go-gitea#15855

The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of go-gitea#15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
lafriks pushed a commit that referenced this issue May 16, 2021
Backport #15855

The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of #15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of go-gitea#15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants