Discussion:
Bug#1037256: debian-installer: GUI font for Japanese was incorrectly rendered
Add Reply
Kentaro HAYASHI
2023-07-04 11:40:01 UTC
Reply
Permalink
Step1: Bundle MotoyaLCedar (MTLc3m.ttf) for fonts-android-udeb.
Step2: Apply this patch for cdebconf package
As MotoyaLCedar is packaged as fonts-motoya-l-cedar already,
making fonts-motoya-l-cedar-udeb and using it may be better.

Regards,
Kentaro HAYASHI
2023-07-06 10:40:01 UTC
Reply
Permalink
FYI:

I've posted a message to ML for collecting feedback.

Proposal: change Japanese font for GUI installer
https://lists.debian.org/debian-boot/2023/06/msg00224.html

Regards,
Kentaro HAYASHI
2023-07-15 04:20:01 UTC
Reply
Permalink
FYI: I've updated a PoC patch. Mainly the explanation of patch was updated.

0001-frontend-avoid-han-unification-for-Japanese-take2.patch
Kentaro HAYASHI
2024-12-27 12:40:01 UTC
Reply
Permalink
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037256#20

Above Message #20 approach might be too ad-hoc, it might be better to
investigate more generic alternative.

just as PoC, it might be useful to apply custom style, but
this is just an idea and not fully confirmed yet.
Cyril Brulebois
2024-12-28 12:00:01 UTC
Reply
Permalink
Hello,
Post by Kentaro HAYASHI
FYI: I've updated a PoC patch. Mainly the explanation of patch was updated.
0001-frontend-avoid-han-unification-for-Japanese-take2.patch
Sorry, I think I was in the post-release cooldown and didn't follow up
at the time. If we wanted to change the font for a specific language,
that's something that's already supported with touching cdebconf.

See src/usr/bin/gtk-set-font in the rootskel-gtk source package.


Cheers,
--
Cyril Brulebois (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Kentaro HAYASHI
2024-12-28 12:20:02 UTC
Reply
Permalink
Post by Cyril Brulebois
Sorry, I think I was in the post-release cooldown and didn't follow up
at the time. If we wanted to change the font for a specific language,
that's something that's already supported with touching cdebconf.
See src/usr/bin/gtk-set-font in the rootskel-gtk source package.
Thanks, I didn't know that way yet.

Surely it seems better to do it there.

Regards,
Cyril Brulebois
2024-12-28 13:40:01 UTC
Reply
Permalink
Post by Kentaro HAYASHI
Thanks, I didn't know that way yet.
You're welcome!
Post by Kentaro HAYASHI
Surely it seems better to do it there.
Alright, I've built (many more but I'm only publishing) two mini.iso,
one called “pristine” (without font-related changes) except it came with
a +10 on the font size to help me spot differences, and another one
called “motoyalcedar” (using MotoyaLCedar for Japanese) also with a +10
on the font size.

Some differences I spotted (keeping in mind I know close to nothing
about Japanese):
- vertical space between lines is less important with MotoyaLCedar;
- hiragana and katakana glyphs are slightly different, but that's the
kind of small differences I'd expect in different fonts, what you
called “font styling”;
- some kanji glyphs looked like they could fall in the “small
differences” category, but your webpage helped me spot 入 in the
hostname screen (first paragraph, first line), making it clear it's
indeed correct with MotoyaLCedar, and incorrect with the default
font. On the following screen (domain name), I think maybe 分 is also
incorrect (Han vs. Japanese), at least that'd be my reading of
https://en.wiktionary.org/wiki/%E5%88%86 (extra horizontal stroke at
the top with the default font, which goes away with MotoyaLCedar)?
(First paragraph, first line, towards the end.)

Images and some screenshots are available at the following location if
others want to check that out:
https://people.debian.org/~kibi/bug-1037256/

(Also contains fonts-motoya-l-cedar_1.01-5_all.udeb which I manually
repacked from its deb counterpart.)


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.

I'm not saying this is a minor issue or “Japanese isn't worth the extra
2 MB” of course, your webpage is pretty clear about how bad it looks to
native speakers, and the “latin” equivalent you included to demonstrate
that is top-notch!

Your webpage mentioned Noto, which we already include (with just Sinhala
and Gujarati in the installer). The source package features more fonts,
but apparently not for Japanese, maybe that would be worth exploring?


In any case it might be worth bumping the font size a little for
Japanese (by 1 or 2, maybe not 10 like I did for the tests above
)?


Cheers,
--
Cyril Brulebois (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Cyril Brulebois
2024-12-28 14:10:02 UTC
Reply
Permalink
Post by Cyril Brulebois
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 (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Kentaro HAYASHI
2024-12-28 15:00:01 UTC
Reply
Permalink
Hi,
Post by Cyril Brulebois
Post by Kentaro HAYASHI
Thanks, I didn't know that way yet.
You're welcome!
Post by Kentaro HAYASHI
Surely it seems better to do it there.
Alright, I've built (many more but I'm only publishing) two mini.iso,
one called “pristine” (without font-related changes) except it came
with a +10 on the font size to help me spot differences, and another
one called “motoyalcedar” (using MotoyaLCedar for Japanese) also with
a +10 on the font size.
Some differences I spotted (keeping in mind I know close to nothing
- vertical space between lines is less important with MotoyaLCedar;
- hiragana and katakana glyphs are slightly different, but that's the
kind of small differences I'd expect in different fonts, what you
called “font styling”;
- some kanji glyphs looked like they could fall in the “small
differences” category, but your webpage helped me spot 入 in the
hostname screen (first paragraph, first line), making it clear it's
indeed correct with MotoyaLCedar, and incorrect with the default
font. On the following screen (domain name), I think maybe 分 is
also incorrect (Han vs. Japanese), at least that'd be my reading of
https://en.wiktionary.org/wiki/%E5%88%86 (extra horizontal stroke at
the top with the default font, which goes away with MotoyaLCedar)?
(First paragraph, first line, towards the end.)
Thank you for looking into this issue.

Yes, there are many different typeface (glyph) were rendererd for
Japanese.

e.g. I've given it a talk before about this issue in local Debian
meeting (NOTE: written by
Japanese )
https://slide.rabbit-shocker.org/authors/kenhys/tokyodebian-d-i-font-202307/?page=8
Post by Cyril Brulebois
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.
I'm not saying this is a minor issue or “Japanese isn't worth the
extra 2 MB” of course, your webpage is pretty clear about how bad it
looks to native speakers, and the “latin” equivalent you included to
demonstrate that is top-notch!
Your webpage mentioned Noto, which we already include (with just
Sinhala and Gujarati in the installer). The source package features
more fonts, but apparently not for Japanese, maybe that would be
worth exploring?
In any case it might be worth bumping the font size a little for
Japanese (by 1 or 2, maybe not 10 like I did for the tests above…)?
At that time (2023), I've considered MotoyaLCedar is the best font
(point of view of size and quality), but idealy
BIZ UDGothic (fonts-morisawa-bizud-gothic) might be the best because it
is universal design font and improves readability and visibility.

But as you say, it takes extra cost about
additional font size as same as MotoyaLCedar (even more).

It is happy if this font-size issue was technically resolved somehow.
(I don't know the way yet )

Regards,
Kentaro HAYASHI
2024-12-28 14:30:01 UTC
Reply
Permalink
Hi,
Post by Kentaro HAYASHI
Post by Cyril Brulebois
Sorry, I think I was in the post-release cooldown and didn't follow
up at the time. If we wanted to change the font for a specific
language, that's something that's already supported with touching
cdebconf.
See src/usr/bin/gtk-set-font in the rootskel-gtk source package.
Thanks, I didn't know that way yet.
Surely it seems better to do it there.
I've tried to fix with following MRs:

* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
* https://salsa.debian.org/fonts-team/fonts-morisawa-bizud-gothic/-/merge_requests/1
* https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/55

Regards,
Cyril Brulebois
2024-12-28 14:50:01 UTC
Reply
Permalink
Hi,
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
* https://salsa.debian.org/fonts-team/fonts-morisawa-bizud-gothic/-/merge_requests/1
* https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/55
Oh, in that case I think we'll really want to look into some compression
thing, since BIZUDGothic-Regular.ttf is even larger than MotoyaLCedar
(4.5M uncompressed, 2.4M compressed).

Size aside, would BIZUDGothic look better than MotoyaLCedar?

And should the font size stay the same for Japanese?


Cheers,
--
Cyril Brulebois (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Kentaro HAYASHI
2024-12-29 07:30:01 UTC
Reply
Permalink
Post by Cyril Brulebois
Hi,
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
* https://salsa.debian.org/fonts-team/fonts-morisawa-bizud-gothic/-/merge_requests/1
* https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/55
Oh, in that case I think we'll really want to look into some
compression thing, since BIZUDGothic-Regular.ttf is even larger than
MotoyaLCedar (4.5M uncompressed, 2.4M compressed).
Size aside, would BIZUDGothic look better than MotoyaLCedar?
If only font name was changed (default 9 point):

* Readability and Visibility:

* BIZ UDGothic > VL Gothic > MotoyaLCedar

Greater is better, thus BIZ UDGothic is best in idealy.

* Readability and Visibility with cosidering quality and disk usage
balance)

* VL Gothic > MotoyaLCedar > BIZ UDGothic

Visibility is better than MotoyaLCedar, so VL Gothic is best.

* Readability and Visibility with cosidering disk usage

* MotoyaLCedar > VL Gothic > BIZ UDGothic

less readability and visibility, but it is better than
nothing and there is significant improvement current Han
-Unification issue.

After all, if disk/memory usage issue was resolved technically in
somewhat, BIZ UDGothic is the best, but if it is difficult or there is
some blocker,
adopting MotoyaLCedar for a while is better compromise solution IMHO.
Post by Cyril Brulebois
And should the font size stay the same for Japanese?
I'll check tweaked version later.

Regards,
Kentaro HAYASHI
2024-12-29 13:30:01 UTC
Reply
Permalink
Post by Kentaro HAYASHI
Post by Cyril Brulebois
And should the font size stay the same for Japanese?
I'll check tweaked version later.
I've checked with 10pt MotoyaLCedar,VL Gothic and BIZ UDGothic.

* MotoyaLCedar 9pt vs 10pt
9pt: font typeface seems blurred, so it is a bit ugly.
10pt: ugly blurred rendering was reduced. it has enough
readability and visibility as others.

* VL Gothic 10pt
Compared to MotoyaLCedar 10pt, it might be hard to distinguish
both of their typeface readability and visibility.

* BIZ UDGothic 10pt
It gives most neat and clear impression in readability and
visibility, but it might be extra ordinary quality for D-I.

With tweaking default font size, e.g. 9pt to 10pt,
readability and visibility might be good enough with MotoyaLCedar in
practical use case.

Regards,
Kentaro HAYASHI
2024-12-31 12:10:01 UTC
Reply
Permalink
FYI:

I've uploaded some screenshot images to check tweaked font
name and default font size with rootskel-gtk outcome.

https://people.debian.org/~kenhys/bug-1037256/
Cyril Brulebois
2025-01-02 13:00:01 UTC
Reply
Permalink
Post by Kentaro HAYASHI
I've checked with 10pt MotoyaLCedar,VL Gothic and BIZ UDGothic.
* MotoyaLCedar 9pt vs 10pt
9pt: font typeface seems blurred, so it is a bit ugly.
10pt: ugly blurred rendering was reduced. it has enough
readability and visibility as others.
* VL Gothic 10pt
Compared to MotoyaLCedar 10pt, it might be hard to distinguish
both of their typeface readability and visibility.
* BIZ UDGothic 10pt
It gives most neat and clear impression in readability and
visibility, but it might be extra ordinary quality for D-I.
With tweaking default font size, e.g. 9pt to 10pt, readability and
visibility might be good enough with MotoyaLCedar in practical use
case.
Alright, thanks for all those tests, and for the summary + proposed
plan of action. If we do implement the compression dance I proposed,
switching to MotoyaLCedar shouldn't be a problem (~ neutral on the
size front). I'll try and work on that before Trixie Alpha 2.

ありがずうございたす。


Cheers,
--
Cyril Brulebois (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Kentaro HAYASHI
2025-01-04 13:10:01 UTC
Reply
Permalink
Hi,
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
I've updated to use MotoyaLCedar.
Post by Kentaro HAYASHI
* https://salsa.debian.org/fonts-team/fonts-morisawa-bizud-gothic/-/merge_requests/1
Closed. (No need anymore)
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/55
Closed. replaced with MR!58

https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/58

Created MR for fonts-motoya-l-cedar.

https://salsa.debian.org/fonts-team/fonts-motoya-l-cedar/-/merge_requests/1

Regards,
Kentaro HAYASHI
2025-01-10 12:20:01 UTC
Reply
Permalink
Hi,
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
Updated to decompress font on demand.

https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/59

Created MR to generate fake font cache in advance.

https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/58
https://salsa.debian.org/fonts-team/fonts-motoya-l-cedar/-/merge_requests/1


Once, even though above MRs were merged, it seems that it needs to
be restarted to reflect font correctly.

(something like switch to shell from GUI installer, then exit ash)

Regards,
Kentaro HAYASHI
2025-01-15 13:40:02 UTC
Reply
Permalink
Post by Kentaro HAYASHI
Hi,
Post by Kentaro HAYASHI
* https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5
Updated to decompress font on demand.
https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/59
Created MR to generate fake font cache in advance.
https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/58
https://salsa.debian.org/fonts-team/fonts-motoya-l-cedar/-/merge_requests/1
Once, even though above MRs were merged, it seems that it needs to
be restarted to reflect font correctly.
(something like switch to shell from GUI installer, then exit ash)
It seems that fixing gtk-set-font is not enough, need to reboot
/sbin/debian-installer (or something), but it causes flickering
(blackout) and
need to re-process localechooser (select language again)
It might be annoying.

How should I terminate them correctly?
Kentaro HAYASHI
2025-01-20 13:20:01 UTC
Reply
Permalink
Post by Kentaro HAYASHI
It seems that fixing gtk-set-font is not enough, need to reboot
/sbin/debian-installer (or something), but it causes flickering
(blackout) and
need to re-process localechooser (select language again)
It might be annoying.
How should I terminate them correctly?
As a PoC, I've created the following MRs.
It works even though it is ad-hoc/ugly way, but
I felt that there is
more better alternative way to fix this issue
if I had a knowledge about d-i internals. :-<

[1] Generate fake font cache for compressed fonts
https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/59

[2] Use compressed font for Japanese
https://salsa.debian.org/installer-team/debian-installer/-/merge_requests/58

[3] Change default font to MotoyaLCedar for Japanese
https://salsa.debian.org/installer-team/rootskel-gtk/-/merge_requests/5

[4] Restart and control language selection for Japanese
https://salsa.debian.org/installer-team/localechooser/-/merge_requests/9

I've also uploaded PoC iso image here.

https://people.debian.org/~kenhys/bug-1037256/index.html

Any feedback are welcome.

Regards,
Cyril Brulebois
2025-01-20 19:20:01 UTC
Reply
Permalink
Hi,
Post by Kentaro HAYASHI
Post by Kentaro HAYASHI
It seems that fixing gtk-set-font is not enough, need to reboot
/sbin/debian-installer (or something), but it causes flickering
(blackout) and
need to re-process localechooser (select language again)
It might be annoying.
How should I terminate them correctly?
As a PoC, I've created the following MRs.
It works even though it is ad-hoc/ugly way, but
I felt that there is
more better alternative way to fix this issue
if I had a knowledge about d-i internals. :-<
I think (I wanted but I'm not sure I did
) I said I would look into this
after Trixie Alpha 1, so if you don't mind waiting a little, I'll look
into it eventually



Cheers,
--
Cyril Brulebois (***@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
Kentaro HAYASHI
2025-01-23 10:30:01 UTC
Reply
Permalink
On Mon, 20 Jan 2025 20:13:24 +0100 Cyril Brulebois <***@debian.org>
wrote:
...
Post by Kentaro HAYASHI
if I had a knowledge about d-i internals. :-<
I think (I wanted but I'm not sure I did…) I said I would look into
this after Trixie Alpha 1, so if you don't mind waiting a little,
I'll look into it eventually…
Thanks!

I'm happy to hear that you still have interest about this issue.
I guess that this issue will not be so attractive for non-Japanese
speaker, just wanted to know how to make it forward. (I'm just curious)

So, I'll wait you look into it.

Regards,

Loading...