Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] media-fonts/noto,getting NotoColorEmoji.ttf to work
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Jul 03, 2018 1:13 pm    Post subject: [solved] media-fonts/noto,getting NotoColorEmoji.ttf to work Reply with quote

This particular font's never fully worked as advertised, but for the past few months I've had to go out of my way to force fontconfig to reject using it, because all its glyphs now render at 128px in size in all freetype-using programs (screenshot, note the few correctly sized characters in there from Symbola).

What am I doing wrong (besides trying to display unicode emoji ofc.)? I'm using ~arch with up-to-date versions of fontconfig, freetype, cairo etc. but I don't see any obviously missing USE flags that would lead to this. Is the font file itself just broken? Is there a replacement in portage that'd actually display at the right size *and* in colour?


Last edited by Ant P. on Tue Aug 07, 2018 4:45 am; edited 1 time in total
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Tue Jul 03, 2018 1:34 pm    Post subject: Reply with quote

link no worky
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Jul 17, 2018 3:00 am    Post subject: Reply with quote

Small update: I've managed to get the colour part to work by installing cairo-9999, the font size is still absurd however.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Aug 07, 2018 4:44 am    Post subject: Reply with quote

Here's a clue:
Code:
$ fc-query /usr/share/fonts/noto/NotoColorEmoji.ttf
Pattern has 27 elts (size 32)
        family: "Noto Color Emoji"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "Noto Color Emoji"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(f)(s)
        width: 100(f)(s)
        pixelsize: 109(f)(s)
        spacing: 100(i)(s)
        foundry: "GOOG"(s)
        antialias: False(s)
        file: "/usr/share/fonts/noto/NotoColorEmoji.ttf"(s)
        index: 0(i)(s)
        outline: False(s)
        scalable: True(s)
...

Note the pixelsize is set (to a huge number), outline=False… and even though scalable=True freetype/fontconfig ignores it and just puts it on screen as is. And so I found out I can fix this via eselect fontconfig enable 10-scale-bitmap-fonts.conf, because this is actually a bitmap font.

But I only want it to scale this font, without ruining others like Terminus. Thus I needed to cut the good bits out of the conf file and put them into local.conf:
/etc/fonts/local.conf:
...
  <!-- force scaling on emoji bitmap fonts -->
  <match target="font">
    <test name="scalable" compare="eq"><bool>true</bool></test>
    <test name="outline"  compare="eq"><bool>false</bool></test>
    <edit name="pixelsizefixupfactor" mode="assign">
      <divide>
        <name target="pattern">pixelsize</name>
        <name target="font">pixelsize</name>
      </divide>
    </edit>
    <edit name="matrix" mode="assign">
      <times>
        <name>matrix</name>
        <matrix>
          <name>pixelsizefixupfactor</name> <double>0</double>
          <double>0</double> <name>pixelsizefixupfactor</name>
        </matrix>
      </times>
    </edit>
    <edit name="size" mode="assign">
      <divide>
        <name>size</name>
        <name>pixelsizefixupfactor</name>
      </divide>
    </edit>
  </match>
...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Sep 20, 2018 11:21 pm    Post subject: Reply with quote

Looks like fontconfig-2.13.1 upstream added a similar fix (use `eselect fontconfig enable 10-scale-bitmap-fonts.conf`), so the above workaround is no longer needed — and in fact, needs to be removed to avoid double-scaling brokenness.
Back to top
View user's profile Send private message
Mr. Tao
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2007
Posts: 147

PostPosted: Wed Apr 03, 2019 9:54 am    Post subject: Reply with quote

I couldn’t get Noto Color Emoji to work on a newly installed system. After a lot of guesswork, I found out that the culprit is fontconfig-infinality. After I have eselect fontconfig disable 52-infinality.conf colour emoji appeared instantly in already running applications.
Back to top
View user's profile Send private message
subkelvin
n00b
n00b


Joined: 13 May 2020
Posts: 3

PostPosted: Tue Jun 09, 2020 12:11 am    Post subject: Reply with quote

Mr. Tao wrote:
I couldn’t get Noto Color Emoji to work on a newly installed system. After a lot of guesswork, I found out that the culprit is fontconfig-infinality. After I have eselect fontconfig disable 52-infinality.conf colour emoji appeared instantly in already running applications.


This saved my day! Only after I disabled the infinality the Noto Emoji Color worked with polybar and i3!
Thanks!
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 130
Location: Estonia

PostPosted: Thu Jan 30, 2025 5:53 pm    Post subject: Reply with quote

Thanks for pointing out the relation to bitmap fonts: this pointed me to noticing for some reason `70-no-bitmaps` had appeared since Aug 2024, which matches the timeline when I think I at one point noticed emojis breaking:

```
2024-08-11T01:13:53 >>> media-libs/fontconfig-2.15.0
```

Why would `70-no-bitmaps` become enabled though, I don't know yet - ebuild itself doesn't seem to have anything related coded :o
_________________
Gentoo since 2004.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 488
Location: Naarm/Melbourne, Australia

PostPosted: Thu Jan 30, 2025 11:09 pm    Post subject: Reply with quote

lkraav wrote:
Why would `70-no-bitmaps` become enabled though, I don't know yet - ebuild itself doesn't seem to have anything related coded :o

Assuming you (or something else) hasn't enabled it via `eselect fontconfig`, is there a file in ~/.config/fontconfig/ (e.g. fonts.conf) that enables it?
_________________
https://wiki.gentoo.org/wiki/User:Flexibeast
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum