After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783489 - Error, about, plugins, applications, and overview pages should use the selected system font
Error, about, plugins, applications, and overview pages should use the select...
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
git master
Other All
: Normal normal
: ---
Assigned To: Adrian Perez
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-06-06 17:06 UTC by Adrian Perez
Modified: 2017-06-30 15:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Use "font: menu" to obtain the system interface font in CSS (2.12 KB, patch)
2017-06-06 17:12 UTC, Adrian Perez
none Details | Review
[PATCH v2] Use "font: menu" to obtain the system interface font in CSS (2.45 KB, patch)
2017-06-30 14:51 UTC, Adrian Perez
committed Details | Review

Description Adrian Perez 2017-06-06 17:06:03 UTC
Steps to reproduce:

 1. Open GNOME's “Tweak Tool”.
 2. At the “Fonts” section, change the “Interface” font to any font
    other than Cantarell.
 3. Open a new tab in Epiphany

Expected outcome:

  The font selected in “Tweak Tool” is used for the thumbnail labels
  in the new tab overview page.

Actual outcome:

  Cantarell is always used.

Additional information:

  Cantarell is also hardcoded as the font to be used for the about
  page that can be reached using the “about:” URL, the plugins
  information page (“about:plugins”), the saved web applications
  page (“about:applications”), and the error pages (for example
  the error shown when loading http://epiphanywebbrowserrules.net/
  which is a domain that does not exist).
Comment 1 Adrian Perez 2017-06-06 17:12:42 UTC
Created attachment 353274 [details] [review]
[PATCH] Use "font: menu" to obtain the system interface font in CSS
Comment 2 Michael Catanzaro 2017-06-06 17:18:06 UTC
Review of attachment 353274 [details] [review]:

OK it's clever, but too much of a hack IMO. This property should be used for... menus.

WebKit has a special CSS property just for this, "-apple-system", see https://webkit.org/blog/3709/using-the-system-font-in-web-content/. Does WebKitGTK+ support either "-apple-system" or "system"? If not, let's add support for the prefixed version. This is a good use case to justify it, IMO.
Comment 3 Michael Catanzaro 2017-06-06 17:23:08 UTC
Looks like our CSS parser already supports it (as both -apple-system and -webkit--system) but it needs implementation in FontCacheFreeType.cpp similar to the implementation in FontCacheMac.cpp. We'll have to add some GTK-specific code there to get the font from GTK+, and for other ports (including WPE) we should get it from Fontconfig instead.
Comment 4 Adrian Perez 2017-06-06 17:43:49 UTC
(In reply to Michael Catanzaro from comment #3)
> Looks like our CSS parser already supports it (as both -apple-system and
> -webkit--system) but it needs implementation in FontCacheFreeType.cpp
> similar to the implementation in FontCacheMac.cpp. We'll have to add some
> GTK-specific code there to get the font from GTK+, and for other ports
> (including WPE) we should get it from Fontconfig instead.

The nice thing about using “font: menu” is that it is part of the CSS
spec (has been for years) and it works already today. On the other hand,
“-apple-system” is engine-specific and from what I got from Myles Maxfield
and from the W3C mailing list thread where “font: system” was proposed, it
seems that it's not likely that it will be specced.

JFTR, the W3C thread is this one:

  https://lists.w3.org/Archives/Public/www-style/2015Jul/0169.html

My conclusion after reading it is that the existing “font: menu” 
(and friends), even when not in widespread use, are better because
they choose not only the family but also the rest of font attributes
(variant, weight, and so on). This means that they chosen font is
expected to also be affected by a11y and i18n settings (e.g. if the
system has a different font for a Japanese locale, it would be picked
inside a “<p lang="ja-jp">...</p>”) — and this is a good thing.

  -
Comment 5 Adrian Perez 2017-06-06 17:51:21 UTC
Fun trivia: using “font: menu; font-size: XYZ;” works all the way
back to Netscape 4.x (that would be a browser from 18 years ago!)
Comment 6 Adrian Perez 2017-06-06 17:53:26 UTC
(In reply to Adrian Perez from comment #5)
> Fun trivia: using “font: menu; font-size: XYZ;” works all the way
> back to Netscape 4.x (that would be a browser from 18 years ago!)

...which means it's not a “clever hack” but simply “using what was
there already in the spec” ;-)
Comment 7 Michael Catanzaro 2017-06-30 03:22:23 UTC
OK, you've convinced me on IRC that we should do this instead of exposing -webkit-system. But it is still pretty confusing, so I'm going to request adding a short comment above each use to explain.
Comment 8 Adrian Perez 2017-06-30 14:51:25 UTC
Created attachment 354735 [details] [review]
[PATCH v2] Use "font: menu" to obtain the system interface font in CSS
Comment 9 Adrian Perez 2017-06-30 14:51:48 UTC
(In reply to Michael Catanzaro from comment #7)
> OK, you've convinced me on IRC that we should do this instead of exposing
> -webkit-system. But it is still pretty confusing, so I'm going to request
> adding a short comment above each use to explain.

Done!