Bug 106460

Summary: emboldening isn't enabled on medium font when requesting bold
Product: fontconfig Reporter: Akira TAGOH <akira>
Component: libraryAssignee: Akira TAGOH <akira>
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: fontconfig-bugs
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch

Description Akira TAGOH 2018-05-10 12:29:57 UTC
$ fc-match -f "family: %{family}\nstyle: %{style}\nembolden: %{embolden}\n" inconsolata  
family: Inconsolata
style: Medium
embolden: 
$ fc-match -f "family: %{family}\nstyle: %{style}\nembolden: %{embolden}\n" inconsolata:bold         
family: Inconsolata
style: Medium
embolden: 

90-synthetic.conf won't be applied due to this:
commit 9efe0689ae130eda75a66ecd853cbe63712378a3
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Fri Sep 15 14:28:12 2017 -0400

    Adjust emboldening logic
    
    Old logic was really bad.  If you requested weight=102 and got a medium
    font (weight=100), it would still enable emboldening...
    
    Adjust it to only embolden if request was >= bold and font was <= regular.

we need to change this logic again to get this working like:
$ fc-match -f "family: %{family}\nstyle: %{style}\nembolden: %{embolden}\n" inconsolata:bold         
family: Inconsolata
style: Medium
embolden: True
Comment 1 Akira TAGOH 2018-05-10 12:31:43 UTC
This causes characters aren't renderred as bold on xterm say. see https://bugzilla.redhat.com/show_bug.cgi?id=1575649
Comment 2 Akira TAGOH 2018-05-10 12:57:39 UTC
to clarify more:

$ fc-match -f "family: %{family}\nstyle: %{style}\nweight: %{weight}\nembolden: %{embolden}\n" inconsolata:bold
family: Inconsolata
style: Medium
weight: 100
embolden:

and expected result are:

$ fc-match -f "family: %{family}\nstyle: %{style}\nweight: %{weight}\nembolden: %{embolden}\n" inconsolata:bold
family: Inconsolata
style: Medium
weight: 200
embolden: True
Comment 3 Akira TAGOH 2018-05-10 13:06:46 UTC
Created attachment 139465 [details] [review]
proposed patch

this may need to be updated more. particularly what if:
1) request was demibold?
2) request was bold and font was demibold?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.