Bug 1332250 - Incorrect font configuration
Summary: Incorrect font configuration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: open-sans-fonts
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Vobornik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1349567 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-02 15:49 UTC by Dag Odenhall
Modified: 2018-06-13 15:18 UTC (History)
10 users (show)

Fixed In Version: open-sans-fonts-1.10-8.fc28
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-13 15:18:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dag Odenhall 2016-05-02 15:49:37 UTC
When a website requests Open Sans, Firefox uses Comfortaa.  I have both fonts installed.  I don't know if the following is the cause, because the matching works correctly with fc-match, but I discovered this and it's still wrong, I think.

The open-sans-fonts package includes this fontconfig rule:

  <alias>
    <family>Open Sans</family>
    <prefer>
      <family>sans-serif</family>
    </prefer>
  </alias>

In my understanding of fontconfig, this is saying "Edit the font family list for Open Sans and prepend the sans-serif font family" i.e. Open Sans itself is given *less* priority than all other sans-serif fonts.  The aajohan-comfortaa-fonts package includes this (correct) rule:

  <alias>
     <family>sans-serif</family>
     <prefer>
	<family>Comfortaa</family>
     </prefer>
  </alias>

And so perhaps C being early in the alphabet or perhaps because being the next fontconfig file in my conf.d (I don't fully understand fontconfig) the combined effect ends up being "When looking for Open Sans, the first match is sans-serif which in turn is Comfortaa".

I think the Open Sans rule above should be edited to something closer to the Comfortaa rule above, like:

 <alias>
    <family>sans-serif</family>
     <prefer>
	<family>Open Sans</family>
     </prefer>
 </alias>

The second rule it contains is also wrong, I think, and not like how any other fonts are configured:

  <alias>
    <family>sans-serif</family>
    <default>
      <family>Open Sans</family>
    </default>
  </alias>

Should probably also swap the families like so:

  <alias>
    <family>Open Sans</family>
    <default>
      <family>sans-serif</family>
    </default>
  </alias>

This Firefox bug seems relevant but I think this is a bug in the packaged font configuration and really unrelated to Firefox (I didn't read the whole bug): https://bugzilla.mozilla.org/show_bug.cgi?id=1245811

Comment 1 Petr Vobornik 2016-05-02 16:54:20 UTC
I don't really understand FontConfig so if somebody knowledgeable can confirm the change then I can update the config.

Comment 2 Alexander Ploumistos 2016-05-02 17:16:57 UTC
According to
https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
Dag is right.

Also, my first font package, which I inherited from someone else, had a similarly structured fontconfig.conf file. I have replicated that configuration in every font package I maintain.

Comment 3 Nicolas Mailhot 2016-05-02 18:29:45 UTC
The correct fontconfig templates for Fedora are documented in fontpackages-devel (in /usr/share/fontconfig/templates).

They've been audited by the fontconfig maintainer

Bundled explanation files document what the rules do

Please use them strictly. fontpackages-devel is required to build font packages in Fedora so the examples are not exactly hidden.

Comment 4 Jan Kurik 2016-07-26 04:57:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 5 Dawid Zych 2017-01-06 10:48:33 UTC
The bug still exists on Fedora 25.
I can confirm that solution provided by Dag fixes the issue.

Comment 6 Hin-Tak Leung 2017-01-28 13:34:06 UTC
It does look like the current config is the opposite of what
basic-font-template.conf recommends. Can we get a fix soon?

Comment 7 Hin-Tak Leung 2017-03-03 15:20:42 UTC
*** Bug 1349567 has been marked as a duplicate of this bug. ***

Comment 8 Danny Brodzik 2017-03-17 01:12:12 UTC
Can confirm this on Fedora 25 with the latest updates. The solution from Dag works for me as well.

Comment 9 Garrett Mitchener 2017-05-06 17:57:15 UTC
On my system the symptom was that firefox chooses Laconic instead of Open Sans.

As suggested, I changed /etc/fonts/conf.d/60-open-sans.conf to the following and it seems to be working.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<fontconfig>
 <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Open Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>Open Sans</family>
    <default>
      <family>sans-serif</family>
    </default>
  </alias>
</fontconfig>

Comment 10 Fedora End Of Life 2017-11-16 19:12:30 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 11 Dag Odenhall 2017-11-22 14:24:05 UTC
Confirmed as unchanged in Fedora 27. Haven't tested if Firefox is still confused by this configuration, but it appears to be incorrect regardless.

Comment 12 Danny Brodzik 2017-11-22 19:17:04 UTC
Firefox is still confused by the incorrect configuration in Fedora 27, with a clean OS and font install. The proposed changes by Dag Odenhall fix the problem for me.

Comment 13 Hin-Tak Leung 2017-12-04 22:23:17 UTC
Just saw this bug on firefox 57.0.1 on fc27.

Comment 14 Vitaly 2018-05-30 19:29:56 UTC
The problem is still in F28 and Rawhide.

Can you merge pull request https://src.fedoraproject.org/rpms/open-sans-fonts/pull-request/1 and rebuild package for F28?

Comment 15 Fedora Update System 2018-06-11 11:04:45 UTC
open-sans-fonts-1.10-8.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-531ea2315c

Comment 16 Petr Vobornik 2018-06-11 11:06:57 UTC
Per, previous automated comments, a build with the fix is available for F28 and rawhide.

Comment 17 Fedora Update System 2018-06-11 16:32:52 UTC
open-sans-fonts-1.10-8.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-531ea2315c

Comment 18 Fedora Update System 2018-06-13 15:18:17 UTC
open-sans-fonts-1.10-8.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.