Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 753569

Summary: media-fonts/noto-emoji: RDEPEND on freetype[png]
Product: Gentoo Linux Reporter: William Breathitt Gray <vilhelm.gray>
Component: Current packagesAssignee: Pacho Ramos <pacho>
Status: RESOLVED OBSOLETE    
Severity: normal CC: jstein, mattst88, sultan
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/18184
https://bugs.gentoo.org/show_bug.cgi?id=759337
https://github.com/gentoo/gentoo/pull/18593
Whiteboard:
Package list:
Runtime testing required: ---

Description William Breathitt Gray 2020-11-08 14:32:41 UTC
The noto-emoji font requires freetype with png support enabled in order to display properly in web browsers such as chromium. Adding RDEPEND="media-libs/freetype[png]" to the noto-emoji ebuild should resolve this issue.
Comment 1 Pacho Ramos gentoo-dev 2020-12-09 17:33:42 UTC
No other distro is pulling the dep from noto-emoji... it's the job of the browser to pull in the needed deps for showing the icons (maybe other browsers will use a different renderer)
Comment 2 Stephan Hartmann (RETIRED) gentoo-dev 2020-12-09 20:23:36 UTC
As suggested in bug #759256, we should add a note to media-fonts/noto-emoji to inform users to install media-libs/freetype with png support to work correctly in other applications.
Comment 3 Pacho Ramos gentoo-dev 2020-12-09 20:59:50 UTC
I still disagree about pulling the dep from here (or any font set that could have color emojis), even as an elog message. 

I think it should belong to the renderer... that is cairo (if I don't misremember). I also see cairo hard depends on libpng... but doesn't pull freetype with png support
Comment 4 William Breathitt Gray 2020-12-10 11:58:59 UTC
(In reply to Pacho Ramos from comment #3)
> I still disagree about pulling the dep from here (or any font set that could
> have color emojis), even as an elog message. 
> 
> I think it should belong to the renderer... that is cairo (if I don't
> misremember). I also see cairo hard depends on libpng... but doesn't pull
> freetype with png support

I think you're right, a font ebuild by itself shouldn't make requirements on how it is rendered. Perhaps updating the cairo dependency is the right way to go; I've opened up a bug page for cairo: https://bugs.gentoo.org/759337
Comment 5 Matt Turner gentoo-dev 2020-12-17 02:31:45 UTC
(In reply to Pacho Ramos from comment #3)
> I still disagree about pulling the dep from here (or any font set that could
> have color emojis), even as an elog message. 

I think this is a bad take. Cairo needs to care that freetype is built in a particular way because some fonts require png support? What if I want to use this font via some other renderer that isn't cairo?

Just put in an elog message.
Comment 6 William Breathitt Gray 2020-12-17 12:01:13 UTC
What's the rationale for including cairo in the BDEPEND? Is it used to build the font, or is it to provide a way to render the built font?
Comment 7 William Breathitt Gray 2020-12-17 12:47:24 UTC
I was considering this a bit further. I don't think font engine requirements should be in the noto-emoji ebuild because users could want to use something else besides freetype for their fonts. The cairo ebuild shouldn't have a specific font engine requirement of PNG support for a similar reason: users may not want PNG support if they don't use PNG fonts.

However, perhaps it would be appropriate to set the png USE flag enabled by default in the freetype ebuild. PNG fonts are common enough that most users will want the png USE flag on by default in freetype -- and the users who actively disable it would be aware their their png fonts will no longer work.
Comment 8 Pacho Ramos gentoo-dev 2020-12-17 16:28:54 UTC
But, what is the use case of cairo (that already requires libpng unconditionally) + freetype without png support? Does it work as expected? 

Also, I don't really like people needing to manually enable USE flags on their system as they will also be set there forever until they remember to drop it (if stops being needed). I also wonder if other fonts providing color emojis will also need to add that message :/
Comment 9 Matt Turner gentoo-dev 2020-12-17 16:43:14 UTC
Does the font need freetype built with png support at runtime? Or does it need freetype built with png support at build-time? I understood that freetype[png] was needed to render the font at runtime.

I agree that it is annoying to have to enable USE flags, especially when the optional dependency is already installed. I guess it's a question for William why he doesn't have USE=png set on what is presumably a desktop system.

We might also ask why freetype doesn't have IUSE=+png if there are common fonts that need png support to render properly. I agree, there's no use case for cairo -> freetype[-png] since cairo already depends on libpng.

I'm not convinced that adding the dep to cairo is sufficient to solve this, but you have convinced me that there's no good reason to avoid the dep either :)
Comment 10 Pacho Ramos gentoo-dev 2020-12-17 19:41:57 UTC
(In reply to Matt Turner from comment #9)
> Does the font need freetype built with png support at runtime? Or does it
> need freetype built with png support at build-time? I understood that
> freetype[png] was needed to render the font at runtime.

Well.. cairo needs full png support to render colored emoji glyphs... I think cairo is currently the only renderer for them... but I have no idea if other renderer with other requirement could appear some day :/
https://www.cairographics.org/news/cairo-1.16.0/
* Support colored emoji glyphs, stored as PNG images in OpenType fonts.

That is the reason I think it is a dep of cairo... in summary... cairo needs freetype[png] to render color fonts

Regarding runtime... it is all runtime -> if freetype has no png support, cairo won't be able to show color glyphs and, then, noto-emoji fonts (or any color font) won't be rendered
Comment 11 Toralf Förster gentoo-dev 2022-01-10 09:24:55 UTC
pls see bug 813474 too
Comment 12 Pacho Ramos gentoo-dev 2023-11-24 12:40:34 UTC
https://github.com/gentoo/gentoo/pull/18593