FS#65485 - [noto-fonts-emoji] Do not enable fontconfig by default

Attached to Project: Arch Linux
Opened by huyizheng (huyizheng) - Thursday, 13 February 2020, 15:40 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 25 March 2020, 14:16 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:

Since now this package has `fontconfig` enabled by default. It adds itself as the fallback font to noto fonts, which may prevent user from using other emoji fonts when using noto fonts as default fonts.

For example, I want to use `noto sans` as my default font, and `joypixels` as my default emoji. If I just write this to my `fonts.conf`:
```
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit mode="prepend" binding="strong" name="family">
<string>Noto Sans</string>
<string>JoyPixels</string>
</edit>
</match>
```
It won't work anymore, because the `noto color emoji` will be inserted as a fallback of `noto sans`, and thus inserted in the front of `joypixels`.

I think it's better just provides an `conf.aval` file, and use some message to notify people how to enable its fontconfig. Just like the package `joypixels`.

Additional info:
* package version(s) 20191016-3
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Antonio Rojas (arojas)
Wednesday, 25 March 2020, 14:16 GMT
Reason for closing:  Fixed
Comment by Daniel M. Capella (polyzen) - Thursday, 13 February 2020, 20:26 GMT
Just wondering, but why have both emoji fonts installed?
Comment by Svito (chpii) - Friday, 14 February 2020, 01:01 GMT
Why even ship fontconfig file at all?

This font works without any extra configuration.
Comment by Antonio Rojas (arojas) - Saturday, 15 February 2020, 09:03 GMT
I think it's important to have this working out of the box, as shown by the multiple upstream KDE bugs being reported about the new Plasma emoji picker not working properly. In the corner case that you want to use the Noto font but a different emoji font, you have a few options: Add a fonconfig snippet that appends the chosen emoji font to the Noto family, use NoExtract to prevent the symlink from being installed, or simply uninstall noto-fonts-emoji.

@chpii No, it doesn't work properly. Without this fontconfig file, install ttf-dejavu, croscore, carlito and caladea and see for yourself.
Comment by Jan Alexander Steffens (heftig) - Tuesday, 24 March 2020, 11:14 GMT
The config is not sane and breaks fallback in various contexts that do not expect emoji glyphs. Please fix the Plasma emoji picker to provide the correct language context (like "fc-match :lang=und-zsye" will get you an emoji font, as expected).
Comment by Link Dupont (link) - Tuesday, 24 March 2020, 11:25 GMT
I found that removing the binding attribute in the match prevents the overly aggressive fallback.

<match>
<test name="family" compare="contains"><string>Noto </string></test>
<!--edit name="family" mode="append" binding="same"-->
<edit name="family" mode="append">
<string>Noto Color Emoji</string>
</edit>
</match>
Comment by Jan Alexander Steffens (heftig) - Tuesday, 24 March 2020, 11:37 GMT
The weak binding (which is weaker than language preferences) might be an acceptable compromise. Arojas, can you please test if this works for you?
Comment by Jan Alexander Steffens (heftig) - Tuesday, 24 March 2020, 11:41 GMT
Also, is there a reason you're modifying the charset?
Comment by Svito (chpii) - Tuesday, 24 March 2020, 11:46 GMT
GNOME/GTK/WebkitGTK implemented standard correctly: https://wiki.archlinux.org/index.php/Talk:Fonts#On_emoji

This is upstream bug which should be reopened: https://bugs.kde.org/show_bug.cgi?id=418125

I could not find upstream Qt bug KDE bug should be dependent on, but as far as I tested Qt does not support Emojis correctly either.
Comment by Antonio Rojas (arojas) - Tuesday, 24 March 2020, 15:27 GMT
weak binding works fine, yes. The charset modification is done so that websites that hardcode the noto font (such as gitlab) don't render digits and spaces as emoji when the user doesn't have noto installed. Another option would be to make noto-emoji depend on noto (and probably split the latin fonts)
Comment by Jan Alexander Steffens (heftig) - Tuesday, 24 March 2020, 16:31 GMT
As seen in https://i.imgur.com/xqT5g9r.png , your workaround did not work, so please remove the charset hack.

Unfortunately, even the weak binding breaks text representation in GTK, making the following string display six color emoji, even though only the first, the third, and the sixth should be colored:

🀄 🀄︎ 🀄️ ✒ ✒︎ ✒️

I have to insist that the config file is removed. You're papering over Qt's broken emoji handling by breaking Unicode-conforming applications.

Loading...