Bug 1303460

Summary: firefox-44.0-3.fc23.x86_64 doesn't respect local fontconfig font family alias customization
Product: [Fedora] Fedora Reporter: Fabrice Bellet <fabrice>
Component: firefoxAssignee: Martin Stransky <stransky>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: dawid.zych, excieve, fabrice, gecko-bugs-nobody, jhorak, pjasicek, quantum.analyst, stransky
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 11:55:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fabrice Bellet 2016-01-31 22:30:00 UTC
Since firefox-44.0, firefox doesn't respect the font family aliases defined locally in ~/.config/fontconfig/fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>
  <match target="font">
    <edit mode="assign" name="hintstyle">
      <const>hintslight</const>
    </edit>
  </match>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>DejaVu Sans Condensed</family>
    </prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer>
      <family>DejaVu Serif Condensed</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>DejaVu Sans Mono</family>
    </prefer>
  </alias>
[...]
</fontconfig>

Comment 1 Fabrice Bellet 2016-01-31 22:52:09 UTC
I can revert to the previous behaviour by setting gfx.font_rendering.fontconfig.fontlist.enabled to false

Comment 2 Artem Hluvchynskyi 2016-02-02 13:56:20 UTC
Just updated to firefox-44.0-3 and font matching went haywire even though I only have systemwide font aliases (/etc/fonts/*). I'm not even sure where does it take the rules from as it started matching sans-serif to Comfortaa and ignored Arial (which is installed).

Making the same config change as Fabrice did, brought everything back to normal.

Comment 3 Artem Hluvchynskyi 2016-02-02 14:46:43 UTC
Right, in my case it seems this font-family rule:
"Helvetica Neue",Helvetica,Arial,sans-serif
and my font config, ended up matching Helvetica to sans-serif directly and then changes in Firefox's font matching logic matched sans-serif (somewhat randomly) to Comfortaa (which among some other fonts have <prefer> for sans-serif in my case) instead of falling back to Arial. So changes to my font configuration (removing <prefer>s for some fonts) ended up somehow matching to Arial in the end with fontlist enabled.

Still this is quite unexpected as fc-match produces different results for sans-serif:
$ fc-match sans-serif
DejaVuSans.ttf: "DejaVu Sans" "Book"

Comment 4 Elliott Sales de Andrade 2016-02-02 21:01:19 UTC
Ah, this must explain why GitHub has started looking terrible. Code blocks use the rule [Consolas, "Liberation Mono", Menlo, Courier, monospace], but somehow Firefox picks NimbusMonL-Regu even though Liberation Mono is installed

Comment 5 Martin Stransky 2016-02-05 12:10:51 UTC
Is that a dupe of Bug 1303585 ?

Comment 6 Fabrice Bellet 2016-02-07 19:05:55 UTC
(In reply to Martin Stransky from comment #5)
> Is that a dupe of Bug 1303585 ?

Hi,

It looks related yes, even If I cannot reproduce exactly the same behavior than the one reported on this other bug report (FF is not concerned by the fonts defined for gnome with gnome-tweak-tool).

The problem I observe happens when "font.name.sans-serif.x-western" is _NOT_ defined and when font.default.x-western is set to sans-serif. In this case, firefox uses the family alias I defined in my ~/.config/fontconfig/fonts.conf  file for sans-serif.

The difference I observe between FF43 and FF44 is that FF44 no longer seems to accept a family font containing the style part of the font : in the case of the font "DejaVu Sans Condensed", "Condensed" is the style, note the " " in the description of the font:

[bellet@bonobo conf.d]$ fc-match  sans-serif
DejaVuSansCondensed.ttf: "DejaVu Sans" "Condensed"
[bellet@bonobo conf.d]$ fc-match -v sans-serif | head
Pattern has 36 elts (size 48)
	family: "DejaVu Sans"(s) "DejaVu Sans Condensed"(s)
	familylang: "en"(s) "en"(s)
	style: "Condensed"(s) "Book"(s)
	stylelang: "en"(s) "en"(s)
	fullname: "DejaVu Sans Condensed"(s)
	fullnamelang: "en"(s)
	slant: 0(i)(s)
	weight: 80(i)(s)
	width: 87(i)(s)


Firefox renders using "DejaVu Sans" font in this case.

Switching to family "Roboto Condensed" in the local fonts.conf works, because Condensed belongs to the family name of this font.

Alternatively, defining the font with font.name.sans-serif.x-western works as expected with a visible difference between "DejaVu Sans" and "DejaVu Sans Condensed".

HTH,

Comment 7 Martin Stransky 2016-02-29 14:33:00 UTC
Firefox 45 should have a fix in fontconfig code - can you please test FF45 Beta? From http://archive.mozilla.org/pub/firefox/candidates/45.0b10-candidates/build1/ for instance. Choose the 64bit or 32bit builds.

Comment 8 Fabrice Bellet 2016-03-02 15:12:25 UTC
nope, bug is still there.

Comment 9 Fedora End Of Life 2016-11-24 15:19:22 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Fabrice Bellet 2016-11-26 20:14:56 UTC
The problem is still there in firefox 50, Fedora 24. Bumping fedora version.

Comment 11 Dawid Zych 2017-01-11 12:34:26 UTC
I have similar problem with Firefox 50.1.0 on Fedora 25. Every font that isn't installed on my computer is substituted for default serif font, even if that particular font has different family aliased in /etc/fonts/conf.d/45-latin.conf.
For example Verdana is defined as sans-serif but Firefox substitutes it for "DejaVu Serif".

$ fc-match Verdana
DejaVuSans.ttf "DejaVu Sans" "Book"

Comment 12 Fedora End Of Life 2017-07-25 19:52:36 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2017-08-08 12:43:41 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 14 Fabrice Bellet 2017-09-05 19:19:38 UTC
I reopen this bug, since the bug is still there in firefox 55, and the workaround gfx.font_rendering.fontconfig.fontlist.enabled=false no longer works.

Comment 15 Fabrice Bellet 2017-09-05 19:22:05 UTC
https://bugzilla.mozilla.org/show_bug.cgi?id=1285533

Comment 16 Fabrice Bellet 2017-09-06 08:09:07 UTC
It seems related to the Family/Subfamily and Preferred Family/Preferred Subfamily distinction that is specific to some fonts, including DejaVuSansCondensed, see:

https://forums.gentoo.org/viewtopic-t-566403.html

and an old mozilla bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=420628

Editing the DejaVuSansCondensed*ttf files, by removing the Preferred* TTF Names, and copying these patched versions in ~/.local/share/fonts makes it work again. Ideally a similar workaround involving just a fonts.conf tweak would be better.

Comment 17 Fedora End Of Life 2018-05-03 08:44:18 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 18 Fedora End Of Life 2018-05-29 11:55:52 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.