Cyril Brulebois <k...@debian.org> (2024-12-28):
> Using motoyalcedar would mean an extra 2 MB in the initramfs, which
> looks like a lot compared to 3 MB for fonts-android-udeb, so maybe it'd
> be worth thinking a little more about this before submitting a udeb
> addition to src:fonts-motoya-l-cedar and adding it to pkg-lists.

With that udeb added, build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/
contains a total of 12 MB worth of *.ttf files.

The biggest (over 1 MB) are:

    1.4M  
./build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/tibetan-machine/TibMachUni-1.901b.ttf
    1.9M  
./build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/motoya-l-cedar/MTLc3m.ttf
    3.3M  
./build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/droid/DroidSansFallback.ttf

As far as I understand, DroidSansFallback.ttf is automatically used when
things aren't available in the default font, which we set to "DejaVu
Sans".

Other fonts are selected explicitly via gtk-set-font and maybe we could
limit the size increase (+20%) by having some fonts compressed in the
initramfs (so that they eat up less RAM for everyone), and uncompress
them on the fly when a language that uses them is chosen?

For example motoya-l-cedar/MTLc3m.ttf when "ja" is chosen, or
tibetan-machine/TibMachUni-1.901b when "dz" or "bo" are chosen.

Compressed, those would take:

    324K  
./build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/tibetan-machine/TibMachUni-1.901b.ttf.xz
    1.1M  
./build/tmp/netboot-gtk/tree/usr/share/fonts/truetype/motoya-l-cedar/MTLc3m.ttf.xz

so 1.5 MB instead of 3.3 MB (thus making the udeb addition almost
cost-free overall).

Compressing every *.ttf file would shrink the total from 12 MB to 4.6 MB
but would mean uncompress operations in a lot of cases, that's why my
initial assessment would be that limiting this to “big fonts, specific
languages” might be the best compromise. Note that I didn't check
whether fontconfig knows how to deal with compressed fonts in the first
place, and I didn't spend a lot of time thinking about this anyway…


(Idea brought to you by having the “compressed Linux kernel modules”
topic in mind, which was fun some time ago.)


Cheers,
-- 
Cyril Brulebois (k...@debian.org)            <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant

Attachment: signature.asc
Description: PGP signature

Reply via email to