Bug 106460 - emboldening isn't enabled on medium font when requesting bold
Summary: emboldening isn't enabled on medium font when requesting bold
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Akira TAGOH
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-10 12:29 UTC by Akira TAGOH
Modified: 2018-05-11 13:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (982 bytes, patch)
2018-05-10 13:06 UTC, Akira TAGOH
Details | Splinter Review

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.