RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1073460 - Make alias Consolas displaying DejaVu Sans Mono
Summary: Make alias Consolas displaying DejaVu Sans Mono
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fontconfig
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Akira TAGOH
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1295396 1297830 1313485
TreeView+ depends on / blocked
 
Reported: 2014-03-06 13:26 UTC by Matěj Cepl
Modified: 2016-11-03 21:18 UTC (History)
5 users (show)

Fixed In Version: fontconfig-2.10.95-8.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 21:18:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
before (217.91 KB, image/png)
2014-03-07 17:49 UTC, Matěj Cepl
no flags Details
after (222.42 KB, image/png)
2014-03-07 17:49 UTC, Matěj Cepl
no flags Details
original presentation (827.14 KB, application/vnd.ms-powerpoint)
2016-01-05 10:08 UTC, Matěj Cepl
no flags Details
export to PDF (642.67 KB, application/pdf)
2016-01-05 11:19 UTC, Matěj Cepl
no flags Details
proposed changes to 45-latin.conf (7.43 KB, application/mbox)
2016-05-25 04:11 UTC, Akira TAGOH
no flags Details
.rej file when applying the patch (2.92 KB, patch)
2016-06-07 13:24 UTC, Matěj Cepl
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2601 0 normal SHIPPED_LIVE Moderate: fontconfig security and bug fix update 2016-11-03 12:12:37 UTC

Description Matěj Cepl 2014-03-06 13:26:25 UTC
Description of problem:
Try to open some PowerPoint presentation using Consolas font for code (e.g. http://www.slideshare.net/migueldeicaza/monkey-space-2013).

Version-Release number of selected component (if applicable):
dejavu-sans-mono-fonts-2.33-6.el7

How reproducible:
100%

Steps to Reproduce:
1.see above
2.
3.

Actual results:
code examples looks ugly

Expected results:
we should use some good replacement for Consolas font

Additional info:
With this trivial /etc/fonts/local.conf I have Impress using DejaVu Sans Mono which looks a way better:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
       <alias binding="same">
         <family>Consolas</family>
         <accept>
         <family>DejaVu Sans Mono</family>
         </accept>
       </alias>
</fontconfig>

Comment 2 Jens Petersen 2014-03-07 01:41:28 UTC
Could you attach a screenshot (for before and after too if you like)
just to make sure we're looking at the same thing.
You mean for example slide 29, etc?

I didn't try your .conf file yet...
Though the slides don't look that bad to me
your idea still might make sense perhaps,
but I don't know if dejavu mono is the best fit to Consolas.
Anyway I feel it would be better to do such a change first
in Fedora, so you might want to report the bug there first.

Comment 3 Matěj Cepl 2014-03-07 17:49:11 UTC
Created attachment 871971 [details]
before

Comment 4 Matěj Cepl 2014-03-07 17:49:35 UTC
Created attachment 871973 [details]
after

Comment 5 Matěj Cepl 2014-03-07 17:51:09 UTC
(In reply to Jens Petersen from comment #2)
> Could you attach a screenshot (for before and after too if you like)
> just to make sure we're looking at the same thing.
> You mean for example slide 29, etc?

And yes, slide 29 is the same thing ... basically anywhere a snippet of the code shows up.

Comment 6 Matěj Cepl 2014-03-07 19:09:54 UTC
(In reply to Jens Petersen from comment #2)
> Anyway I feel it would be better to do such a change first
> in Fedora, so you might want to report the bug there first.

It certainly should be fixed in Fedora as well, but I believe this is very simple just a configuration fix, and it would serve our enterprise customers as well.

Comment 7 RHEL Program Management 2014-03-22 05:51:07 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 10 Akira TAGOH 2015-12-08 10:37:35 UTC
dunno what font was actually used in "before" screenshot though, that looks like font was rendered with wrong hinting. in Fedora, we have a policy to have a separate configuration files for fontconfig per fonts and inherited into RHEL as well, it should be fixed in that font package IMHO (not to have an alias for consolas but proper hinting to have better looks). aside from that having all of aliases into fontconfig is difficult. if it isn't for a font we are packaging, you better do that in your local config as you did as a workaround.

(In reply to Jens Petersen from comment #2)
> but I don't know if dejavu mono is the best fit to Consolas.

me meither. so if we really need to fix this in fontconfig anyway, I would propose to have an alias for consolas to monospace but not to a specific font.

Comment 11 Jens Petersen 2016-01-05 07:08:06 UTC
Matěj, could you determine which font was used in the 'before' screenshot?

Comment 12 Matěj Cepl 2016-01-05 10:08:55 UTC
Created attachment 1111777 [details]
original presentation

Just for the sake of completness

Comment 13 Matěj Cepl 2016-01-05 11:19:32 UTC
Created attachment 1111801 [details]
export to PDF

(In reply to Jens Petersen from comment #11)
> Matěj, could you determine which font was used in the 'before' screenshot?

OK, after uninstalling all my third-party fonts I got to point where I can reproduce it.

There are two lines of attack:

1) exported PDF manifests exactly the same behavior to me (see attached),
2) according to LO developers, there is no way how to find out the substituted font used, but it is actually rather easy with fc-match:

~$ fc-match Consolas
DejaVuSans.ttf: "DejaVu Sans" "Book"
~$

Which is obviously a wrong idea for the monospace font.

Comment 14 Akira TAGOH 2016-01-06 02:29:45 UTC
That is because fontconfig adds sans-serif into the font pattern as a last resort to find out a better font if it doesn't contain generic aliases such as sans-serif, serif, or monospace.

As I said earlier, supporting all of fonts in fontconfig is difficult and maybe not realistic. IMHO ideally applications which generate documentations should adds a proper fallback too because they should know what it is. so we can avoid the endless complaints like this...

Comment 15 Jens Petersen 2016-01-06 03:10:12 UTC
Is this better in Fedora 23 say (with LiberOffice 5)?

Comment 16 Matěj Cepl 2016-01-06 15:20:33 UTC
(In reply to Jens Petersen from comment #15)
> Is this better in Fedora 23 say (with LiberOffice 5)?

I don't have any Fedora around and the internal CSB repo of LO still has only libreoffice-impress-4.4.7.2-2.el7.csb.x86_64

Comment 17 Matěj Cepl 2016-01-06 15:22:27 UTC
(In reply to Akira TAGOH from comment #14)
> As I said earlier, supporting all of fonts in fontconfig is difficult and
> maybe not realistic.

I am not talking about ALL fonts, just the most well-known ones. We already support Adobe basic fonts (e.g., Times), so I propose just adding the Microsoft ones as well (whatever is freely provided with MS Office or MS Windows).

Comment 19 Akira TAGOH 2016-02-02 11:12:39 UTC
So what a solution do you want to see for this? Is an alias to Monospace for Consolas enough? or want to have an alias to DejaVu Sans Mono?

Comment 20 Matěj Cepl 2016-02-02 17:51:47 UTC
(In reply to Akira TAGOH from comment #19)
> So what a solution do you want to see for this? Is an alias to Monospace for
> Consolas enough? or want to have an alias to DejaVu Sans Mono?

Well, I was thinking about aliases of all these fonts

https://en.wikipedia.org/wiki/Category:Windows_Vista_typefaces
https://en.wikipedia.org/wiki/Category:Microsoft_typefaces

or (this is probably a better list) https://www.microsoft.com/typography/fonts/product.aspx?PID=164 (not sure about non-Latin scripts, but we may need them as well)?

and it really doesn't matter that much IMHO what fonts will be actually used, so yes either Monospace or DejaVu Sans Mono is fine with me.

Comment 21 Akira TAGOH 2016-02-10 03:11:21 UTC
Okay, I'll try to manage this in fontconfig then.

Comment 22 Akira TAGOH 2016-05-25 04:11:50 UTC
Created attachment 1161306 [details]
proposed changes to 45-latin.conf

Comment 23 Jens Petersen 2016-05-31 07:28:04 UTC
Thanks, any suggestions on how best to test the patch?
I mean both for functionality and against potential regressions.

Comment 24 Akira TAGOH 2016-05-31 09:30:53 UTC
all of the proposed changes are to add 'default' tag i.e. appending a family to the end of the list. so that shouldn't affect the usual queries except it doesn't originally match any without this change. for functional testing, requesting those fonts should simply works and see what typefaces it returns.

Comment 25 Matěj Cepl 2016-05-31 09:39:16 UTC
(In reply to Jens Petersen from comment #23)
> Thanks, any suggestions on how best to test the patch?
> I mean both for functionality and against potential regressions.

The manual testing, prepare set of documents on Windows (e.g., the attached slides), and check they display correctly? As of automatic testing I have no idea (and we have this problem in Desktop QA as well; comparing screenshots seems like incredibly brittle technology, but I don't think I can imagine much anything else). Whatever you do for other fonts?

Comment 26 Jens Petersen 2016-06-07 06:47:59 UTC
Has anyone tried the patch?

Comment 27 Matěj Cepl 2016-06-07 13:24:25 UTC
Created attachment 1165647 [details]
.rej file when applying the patch

When trying to patch the 45-latin.conf in /usr/share/fontconfig/conf.avail I got:

mitmanek:conf.avail# patch -p2 -z.orig </home/matej/0001-45-latin.conf-Add-some-Windows-fonts-to-categorize-t.patch 
patching file 45-latin.conf
Hunk #2 succeeded at 54 (offset -4 lines).
Hunk #3 FAILED at 70.
Hunk #5 FAILED at 161.
Hunk #6 succeeded at 203 with fuzz 1 (offset -12 lines).
2 out of 6 hunks FAILED -- saving rejects to file 45-latin.conf.rej

And the *.rej file is attached.

Comment 28 Matěj Cepl 2016-06-07 13:54:18 UTC
Otherwise when I have fixed the .rej issues, I get perfectly working stuff, which seems to make LOImpress working on the attached presentation.

Comment 29 Akira TAGOH 2016-06-10 06:34:52 UTC
Okay, fixed in 2.10.95-8.el7

Comment 31 Matěj Cepl 2016-08-06 10:16:35 UTC
Yes, works perfectly. Thank you

Comment 33 errata-xmlrpc 2016-11-03 21:18:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2601.html


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