View previous topic :: View next topic |
Author |
Message |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 5458
|
Posted: Tue Jul 03, 2018 1:13 pm Post subject: [solved] media-fonts/noto,getting NotoColorEmoji.ttf to work |
|
|
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 |
|
 |
bunder Bodhisattva

Joined: 10 Apr 2004 Posts: 5780
|
Posted: Tue Jul 03, 2018 1:34 pm Post subject: |
|
|
link no worky _________________ overlay | patches
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
|
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 5458
|
Posted: Tue Jul 17, 2018 3:00 am Post subject: |
|
|
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 |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 5458
|
Posted: Tue Aug 07, 2018 4:44 am Post subject: |
|
|
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 |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 5458
|
Posted: Thu Sep 20, 2018 11:21 pm Post subject: |
|
|
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 |
|
 |
|