Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 678432 - media-fonts/noto should add USE flags to limit size of installed contents
Summary: media-fonts/noto should add USE flags to limit size of installed contents
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 6 votes (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-20 18:17 UTC by Michael Hofmann
Modified: 2020-12-25 05:14 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild with additional USE flags (proof of concept) (noto-20181024-r1.ebuild,3.58 KB, text/plain)
2019-02-21 01:34 UTC, Michael Hofmann
Details
Description of additional USE flags (metadata.xml,715 bytes, text/xml)
2019-02-21 01:36 UTC, Michael Hofmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hofmann 2019-02-20 18:17:03 UTC
Noto is a nice font - I use it every day.

Unfortunately, its size has grown considerably:
- noto-20170403.tar.xz:  11 MB
- noto-20181024.tar.gz: 727 MB

I just emerged noto-20181024. The size of /usr/share/fonts/noto is 365MB. That's too much.

Another problem is the font selector in LibreOffice (and probably in other applications). It shows hundreds of entries for Noto. That's too much, and it's difficult to find and select any font now.

Most of the installed fonts are font variants/scripts most people won't need or use (Thai, Tamil, Sinhala, Khmer, etc.).

I propose to introduce new USE flags that select the font variants that will be installed. We already have 'cjk', but we need more. I could make a proposal for such USE flags, if people generally agree. Or would it make sense to let L10N or LINGUAS decide which font variants will be installed?
Comment 1 Michael Hofmann 2019-02-20 20:14:26 UTC
I tried to divide the fonts in noto-20181024 into the following groups:


1) Croscore fonts

noto-20181024 contains the fonts Arimo, Cousine and Tinos:

- Arimo-{Regular,Italic,Bold,BoldItalic}.ttf 
- Cousine-{Regular,Italic,Bold,BoldItalic}.ttf 
- Tinos-{Regular,Italic,Bold,BoldItalic}.ttf

Those fonts are the 'croscore' fonts:
   
    https://en.wikipedia.org/wiki/Croscore_fonts

I'm not sure they belong to Noto at all. We could add a USE flag 'croscore', which enables or disables those fonts.


2) Noto base fonts

That's what probably everbody wants to have:

- NotoSerif-{Regular,Italic,Bold,BoldItalic}.ttf 
- NotoSans-{Regular,Italic,Bold,BoldItalic}.ttf 
- NotoSansMono-{Regular,Bold}.ttf
- NotoSans{Symbols,Symbols2}-Regular.ttf


3) Extended base fonts

Additional styles, mostly for graphics designers and font experts:

- NotoSerif-*.ttf 
- NotoSans-*.ttf 
- NotoSansMono-*.ttf 
- NotoSansDisplay-*.ttf 
- NotoSerifDisplay-*.ttf 
- NotoMusic-*.ttf
- NotoSymbols-*.ttf
- NotoSymbols2-*.ttf


4) Additional Scripts

- All other fonts. I doubt that anybody wants all of those fonts installed. It would be nice to have a mechanism that could select individual fonts, something like 

   noto_scripts="Kannada Thai Hebrew"

But I guess that's too complicated.


5) CJK fonts

Those fonts are already handled in package noto-cjk.
Comment 2 Michael Hofmann 2019-02-21 01:34:55 UTC
Created attachment 565978 [details]
ebuild with additional USE flags (proof of concept)
Comment 3 Michael Hofmann 2019-02-21 01:36:35 UTC
Created attachment 565980 [details]
Description of additional USE flags
Comment 4 Michael Hofmann 2019-02-21 01:43:03 UTC
I created and uploaded an ebuild with additional USE flags as described in comment 1.

The ebuild works, but it's not perfect. It's mostly a proof of concept a basis for further discussions.
Comment 5 David Flogeras 2019-02-21 11:36:24 UTC
I also feel this is too much.  For a mandatory dep of plasma, its tarball alone is now bigger than all of my plasma/frameworks/qt tarballs summed up.  I know, disk space is cheap, but that's a slippery slope.  >1GB combined tarball and installed files so that I get one font that I have no choice in the matter if I use plasma desktop.

As Michael said, all that most users probably need/want is NotoSans, NotoSerif, NotoSansMono.  Maybe we could have a noto-lite package (and a stripped down tar.xz to match) that only has the minimum and put it behind a virtual/noto.
Comment 6 Boris Carvajal 2019-02-22 23:10:14 UTC
Could something similar be done to noto-cjk package?
Last version is 1.78 GiB on disk.
Comment 7 Larry the Git Cow gentoo-dev 2019-06-02 09:50:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abfc589d745ac2b060c8f228612327b23abad95f

commit abfc589d745ac2b060c8f228612327b23abad95f
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2019-06-02 09:50:07 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2019-06-02 09:50:07 +0000

    media-fonts/noto: Version bump
    
    Also add an optional extra USE flag allowing people to drop some fonts to
    reduce disk space usage (#678432)
    
    Closes: https://bugs.gentoo.org/687094
    Bug: https://bugs.gentoo.org/678432
    Package-Manager: Portage-2.3.67, Repoman-2.3.13
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

 media-fonts/noto/Manifest             |  1 +
 media-fonts/noto/metadata.xml         |  3 +++
 media-fonts/noto/noto-20190524.ebuild | 43 +++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+)
Comment 8 Michael 'veremitz' Everitt 2019-10-27 19:13:06 UTC
I think this would probably be better governed by the savedconfig mechanism in portage via this eclass: https://devmanual.gentoo.org/eclass-reference/savedconfig.eclass/index.html .

Other consumers, eg. linux-firmware have a great deal of 'volume'/bulk and can be slimmed down in a similar fashion.

What would be nice is a mechanism to install -just- the saveconfig file in /etc/portage/savedconfig on first emerge, to allow you to select required files, before you have to blow the space on the whole archive, but I accept this is a FEATUREREQ which doesn't belong on this bug.
Comment 9 Andrew Udvare 2020-04-14 14:33:49 UTC
I had a pull request to reduce even further with a lot of L10N flags and normal USE flags. I think this is the best way because it respects a user's L10N setting but I understand this may be difficult to maintain.

https://github.com/gentoo/gentoo/pull/10818/files#diff-e2fc8137f17d3b2761ae9b11114fd2c7

Most people can probably survive with just the main font and their primary language which might include CJK Noto fonts. In that case, the user's L10N in make.conf is the best source of what the user may want.

Then there are extremities IMHO, like Linear A which has never been deciphered. I've tried to separate these ancient unused scripts out where it makes sense. Linear A and B are together in a single USE flag 'linear'. These would not be installed by default because of their rarity. To reduce maintenance, maybe we could also include non-spoken languages in the 'ancient' USE flag rather than using L10N?

Lastly USE flags mono, display and symbols are enabled by default. Respectively, monospace, symbol fonts, and 'display' fonts get installed.
Comment 10 MarisN 2020-04-20 10:18:48 UTC
(In reply to Andrew Udvare from comment #9)
> I had a pull request to reduce even further with a lot of L10N flags and
> normal USE flags. I think this is the best way because it respects a user's
> L10N setting but I understand this may be difficult to maintain.
This one looks like a nightmare to figure out how to get a particular set of fonts installed:
Should I use USE flag or L10N?
How can I get a single font from L10N set without enabling full L10N support of particular language?

SCRIPTS approach as per comment 4 could work.
But IMHO the least amount of work in maintaining ebuild (an important aspect!) would be to go with savedconfig option as suggested in comment 8. Still we could then go with USE flags for Croscore and Noto base (comment 1) thus keeping savedconfig only as an extension on the top of Croscore and Noto base.

PS. Please change status to Confirmed
Comment 11 picard 2020-08-16 15:42:57 UTC
This need to dealt with, current Noto package takes half Gig of disk space just with the X use.
Populating all font selectors in various apps with countless entries
Comment 12 fakhri.satu@gmail.com 2020-12-25 03:25:14 UTC
Hi, all. 
I am relatively new to Gentoo so I still don't understand fully how Gentoo packaging policy works. I want to know if splitting the fonts to several packages could be considered or not. The way I understand it, using USE flags still requires downloading the whole package as opposed to downloading the needed packages if it's split. I think this font's size will keep growing.
Comment 13 Arfrever Frehtes Taifersar Arahesis 2020-12-25 05:14:52 UTC
(In reply to fakhri.satu@gmail.com from comment #12)

media-fonts/noto ebuilds specify SRC_URI for downloading of GitHub-generated archive of https://github.com/googlei18n/noto-fonts repository at specified commit.

GitHub does not support generating of archives of specific subdirectory of repository.