Bug 19592 - grub2 theme fonts need extra glyphs for i18n support
Summary: grub2 theme fonts need extra glyphs for i18n support
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal minor
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-15 20:40 CEST by Renato Dali
Modified: 2019-01-21 00:42 CET (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
Photo showing mismatching characters. (27.50 KB, image/jpeg)
2016-10-17 02:32 CEST, Renato Dali
Details
updated font characters (6.85 KB, image/png)
2016-10-18 16:04 CEST, Barry Jackson
Details
updated grub2 in French screenshot (7.03 KB, image/png)
2016-10-18 21:42 CEST, Barry Jackson
Details
Screenshot from Live ISO boot menu (czech) (140.85 KB, image/png)
2019-01-15 00:03 CET, Martin Whitaker
Details
Screenshot from Live ISO boot menu (german) (140.74 KB, image/png)
2019-01-15 00:04 CET, Martin Whitaker
Details
Screenshot from Live ISO boot menu (slovenian) (139.72 KB, image/png)
2019-01-15 00:04 CET, Martin Whitaker
Details
Screenshot from Live ISO boot menu (swedish) (139.45 KB, image/png)
2019-01-15 00:05 CET, Martin Whitaker
Details
Screenshot from Live ISO boot menu (turkish) (140.60 KB, image/png)
2019-01-15 00:06 CET, Martin Whitaker
Details

Description Renato Dali 2016-10-15 20:40:51 CEST
Description of problem:

Default font for grub2 (would it be the file unicode.pf2?) looks ok in English but not so much in Portuguese.

Words with diacritics (like "opções") show that the font has different base formats for "c" and "ç" which is displeasing and lends a bad image to the distro, even as it's starting up.

Version-Release number of selected component (if applicable):

?

How reproducible:

I suppose always, but tested only once -- besides I'm testing the English version now because of other needs.

Steps to Reproduce:
1. Install Mageia 6 sta 1 with Xfce, no updates.
2. Reboot.
3. Grub screen shows up with ugly chars.

Additionally:

Google fonts has a lot of excellent font options (heh!) for use (I think one should look at licence issues, of course). It is possible to preview whether desired special chars are defined or render as tofu.

This page might also be useful:

http://unix.stackexchange.com/questions/31672/can-grub-font-size-be-customised

Thanks.
Comment 1 Renato Dali 2016-10-15 20:58:35 CEST
More descriptive title changed after (aham) looking for similar bugs... :-[

Summary: Bad grub2 font. => Bad grub2 typeface with mismatching accented chars.

Comment 2 Renato Dali 2016-10-16 16:47:06 CEST
An important missing detail in "Steps to Reproduce" is that I chose "Português do Brasil" as "Language to use" (on the first installer screen).

I also tried with English, as I say above, but without accented chars, the resulting grub screen is quite tidy.

IMHO the chosen font is consistent with the one in the Mageia logo (which is pleasant); lower resolutions make the jaggies in letters more evident, though.
Comment 3 Barry Jackson 2016-10-16 18:34:55 CEST
This is interesting as we have not had any complaints in Mageia 4 and 5 about the font which has not changed.

Could you try installing the package "grub2-mageia-theme-dejavu".

Does this look better for you?

You can simply re-install "grub2-mageia-theme" to remove it.

CC: (none) => zen25000

Comment 4 Marja Van Waes 2016-10-16 21:24:04 CEST
@ Barry

I hope you don't mind my assigning to you. Please reassign if you don't agree.

CC: (none) => marja11
Assignee: bugsquad => zen25000

Comment 5 Barry Jackson 2016-10-17 00:50:06 CEST
(In reply to Marja van Waes from comment #4)
> @ Barry
> 
> I hope you don't mind my assigning to you. Please reassign if you don't
> agree.

No - that's fine.

@Renato Dali
Do you have a screenshot of the boot menu in Português?
Comment 6 Renato Dali 2016-10-17 02:32:36 CEST
Created attachment 8553 [details]
Photo showing mismatching characters.
Comment 7 Renato Dali 2016-10-17 02:38:48 CEST
Hi, Barry,

Regarding the themes, I've noticed I got version 0.git10457.8.mga6, but 463.3 is available for update. I will try that one and then the dejavu one.

Thanks for your attention to the case.
Comment 8 Renato Dali 2016-10-17 04:39:00 CEST
Well, 463.3 has the new theme (the recent contest winner).

Unfortunately, the problems with ç and õ are still present.

The Dejavu theme also has the same bad looks. Since Dejavu is a very complete typeface, I wonder if generation of unicode.pf2 was incorrect or whether it's a problem with grub2 itself...
Comment 9 Rémi Verschelde 2016-10-17 14:59:13 CEST
The "potion" font derived from the Mageia logo has no support for diacritics, it's only basic ascii. So maybe we should start defaulting to dejavu or similar to be i18n-friendly.

> The Dejavu theme also has the same bad looks. Since Dejavu is a very complete typeface, I wonder if generation of unicode.pf2 was incorrect or whether it's a problem with grub2 itself...

That's definitely a bug, as the font itself should indeed have those glyphs.
Comment 10 Barry Jackson 2016-10-17 18:24:57 CEST
(In reply to Rémi Verschelde from comment #9)
> The "potion" font derived from the Mageia logo has no support for
> diacritics, it's only basic ascii. So maybe we should start defaulting to
> dejavu or similar to be i18n-friendly.
> 
> > The Dejavu theme also has the same bad looks. Since Dejavu is a very complete typeface, I wonder if generation of unicode.pf2 was incorrect or whether it's a problem with grub2 itself...
> 

No it's not related to unicode.pf2

> That's definitely a bug, as the font itself should indeed have those glyphs.

Yes, this is down to the use of a limited range in the conversion of the fonts to pf2 which was done to keep the file sizes to a minimum.

Strange that it's not been reported before.

I will take a look at it.
Comment 11 Barry Jackson 2016-10-17 23:17:36 CEST
OK this is fixed for dejavu in grub2-mageia-theme-dejavu-1.0-3.mga6 - please test when it hits your favourite mirror :)

The mageialogo font will take a lot longer but I am working on it ;)
Barry Jackson 2016-10-17 23:19:18 CEST

Summary: Bad grub2 typeface with mismatching accented chars. => grub2 theme fonts need extra glyphs for i18n support

Comment 12 Renato Dali 2016-10-18 04:55:22 CEST
I can confirm the fix was effective: the letters now have a uniform look.

I also noticed the unselected options are displayed in black which probably will be OK with the new light-blue Mga6 background -- but they look invisible on the Mga5 space/starry background.

Thanks, Barry.
Comment 13 Renato Dali 2016-10-18 05:01:42 CEST
I found this picture on Mageia's wiki:

https://wiki.mageia.org/en/File:KO-grub2-boot1.png

I see the blue letters ("Advanced options...") in black, which makes them almost invisible (the background I see is exactly as shown in the picture).

The other grub2-theme (463.3) IIRC already had the new contest winner theme.
Comment 14 Barry Jackson 2016-10-18 14:42:29 CEST
(In reply to Renato Dali from comment #12)
> I can confirm the fix was effective: the letters now have a uniform look.
> 
> I also noticed the unselected options are displayed in black which probably
> will be OK with the new light-blue Mga6 background -- but they look
> invisible on the Mga5 space/starry background.

Why are you seeing the Mga5 background? Are you testing in Mageia 5?

The unselected text colour was changed for Mageia 6 to provide better contrast against the new background, (it's not quite black but getting close ;)

If you are in Mga6 then something is wrong as you should now be seeing the correct background.

What is the output of

tree /boot/grub2/themes

Are the only characters that appear wrong for you as shown in your screenshot?
Do they ever appear in the actual list of systems to boot or anywhere else?
Comment 15 Barry Jackson 2016-10-18 16:04:41 CEST
Created attachment 8571 [details]
updated font characters

(In reply to Rémi Verschelde from comment #9)
> The "potion" font derived from the Mageia logo has no support for
> diacritics, it's only basic ascii. So maybe we should start defaulting to
> dejavu or similar to be i18n-friendly.
> 

This may be the way to go.

I have not checked what happens in grub2 for non-latin languages but for the immediate case like Portugese, I can add the most common accents etc. manually to the .bfd files we use to create the .pf2 files that grub2 uses.

I did this using a bfd editor, but sadly it's output is incompatible with grub2-mkfont so that was a wasted few hours ;\ Fontforge however does produce usable results.

If characters are not available then AFAICT grub2 falls back to using unifont, so I assume that e.g. Arabic etc. will render reasonably well with that - hence the lack of reports.

I will add all the accented etc. characters in the 8 bit ASCII set to the MageiaLogo-*.pf2's and do some test installs in various Latin based languages and see how it goes. If that is OK then maybe we can keep the status quo for Mga6 and think about a new full i18n font for Mga7.
WDYT?
Comment 16 Barry Jackson 2016-10-18 21:42:31 CEST
Created attachment 8573 [details]
updated grub2 in French screenshot

This now seems OK for the langs that I have checked.
Nobody ever commented on the previously missing accent in French!

I will push an updated grub2 later and then close this.
Comment 17 Barry Jackson 2016-10-18 22:43:03 CEST
grub2-2.02-0.git10463.4.mga6 has been pushed to core with the updates - please test grub2-mageia-theme when it arrives.

@Renato
Many thanks for reporting this issue which would otherwise have gone unnoticed. 

Please re-open if you see any regressions.

Closing as fixed.

Resolution: (none) => FIXED
Status: NEW => RESOLVED

Comment 18 Renato Dali 2016-10-19 03:27:29 CEST
(In reply to Barry Jackson from comment #14)
> (In reply to Renato Dali from comment #12)
> > I can confirm the fix was effective: the letters now have a uniform look.

> 
> Why are you seeing the Mga5 background? Are you testing in Mageia 5?

Hmm, I guess Mga6sta1 has an old theme version. Probably the very first big update (usually hundreds of files) would bring grub2-theme from 457.8 to 463.3 (now 463.4).

I'm not sure it does, though. *Now*, to save time, I'm testing just the parts we're interested in. In comment #8, I state I update grub2-theme to 463.3 and saw the new (Mageia 6) theme. But the dejavu-theme apparently doens't touch the background (or might even revert it to Mageia 5 -- at least on this machine, it was installed over the original theme on DVD and stars were kept).

> 
> The unselected text colour was changed for Mageia 6 to provide better
> contrast against the new background, (it's not quite black but getting close
> ;)

It's a nice combination of colors, I think.

> 
> If you are in Mga6 then something is wrong as you should now be seeing the
> correct background.
> 
> What is the output of
> 
> tree /boot/grub2/themes

[zz@localhost ~]$ tree /boot/grub2/themes
/boot/grub2/themes
âââ grub2-mageia-default.png
âââ mageia-dejavu
    âââ DejaVuSans-Bold-14.pf2
    âââ DejaVuSans-Bold-18.pf2
    âââ DejaVuSans-Bold-20.pf2
    âââ DejaVuSans-Bold-24.pf2
    âââ grub2-mageia-default.png -> ../grub2-mageia-default.png
    âââ theme.txt

1 directory, 7 files


> 
> Are the only characters that appear wrong for you as shown in your
> screenshot?

Yes. This is because is a new (test) installation (no previous kernels) and "Mageia" has no accents.

> Do they ever appear in the actual list of systems to boot or anywhere else?

I didn't notice. I will reboot, pay attention and report here in case there's another.

BTW, I've seen your pics and the new Mageia font. I've noticed the "õ" is smaller than the regular "o" (in the French word "Options" (when compared to e.g. "p"). That has a retro look; also, it seems you get boot screens at a higher resolution than me, so the chars look less jaggy.
Comment 19 Renato Dali 2016-10-19 03:35:02 CEST
Thank you, Barry and all the Mageia folks!

PS: Regarding why this was not reported before... sometimes I see something and would like to report a bug, but time constraints or worrying about some much more complicated situation gets in the way. Even if the issue is less important.

I must also report a bug to which a workaround is disabling acceleration in xorg.conf (for the sisimedia driver). I simply didn't have the time as of yet...
Comment 20 Barry Jackson 2016-10-19 14:00:40 CEST
(In reply to Renato Dali from comment #18)

> BTW, I've seen your pics and the new Mageia font. I've noticed the "õ" is
> smaller than the regular "o" (in the French word "Options" (when compared to
> e.g. "p"). 

I think that is fixed in the final version now in cauldron. Accented characters should be the same size as non-accented in lower case as there is room for the accents, whereas upper case with accents (if they ever get used) have been squashed to make room for the accents within the restricted matrix.

Cheers,
Barry
Comment 21 Renato Dali 2016-10-19 14:16:29 CEST
That's great and it'll look more polished that way -- I just want to make clear I was not complaining. That difference in size reminds me of ancient text mode terminals... also, paradoxically, 8-bit visuals and music are considered cool these days.

> whereas upper case with accents (if they ever get used) have been squashed to make room for the accents within the restricted matrix.

This ^.

The French people could inform us better about that, but I seem to recall a rule by which uppercase French letters were written without accents. I don't know if this is old or still holds today, but it could explain why the lack of some accents go unreported.
Comment 22 Rémi Verschelde 2016-10-19 14:25:29 CEST
<off topic>

(In reply to Renato Dali from comment #21)
> The French people could inform us better about that, but I seem to recall a
> rule by which uppercase French letters were written without accents. I don't
> know if this is old or still holds today, but it could explain why the lack
> of some accents go unreported.

That "rule" was actually because both the Azerty keyboard and Microsoft Windows' input left (leave) of lot to be desired. Nowadays most input systems can autocorrect those and put the accents, and us happy Linux users can just use CAPSLOCK + é to input Ã. It's still common to see upper case letter without accents when the writer did not know how to input them, but when it can be done, it's good practice to use those accents even on upper case letter :)

</off topic>
Comment 23 Renato Dali 2016-10-20 02:40:36 CEST
Though our ABNT-2 (Brazilian Technical Standards Association) keyboards are kinda reasonable, IMHO keyboard design can be easily improved. Thanks for the info...
Comment 24 Martin Whitaker 2019-01-15 00:00:04 CET
The Mageia 7 beta1/beta2 ISOs show there are still some missing glyphs. Well, actually a lot of missing glyphs, but I'm not expecting non-Latin scripts to be supported. I'll attach some screenshots after this.

I could use the DejaVu theme instead, but I think the font in the maggy theme looks better as well as making the theme more distinctive.

It might be better to reduce the font size for the menu entries, to blend with the unsupported scripts.

Resolution: FIXED => (none)
CC: (none) => mageia
Status: RESOLVED => REOPENED

Comment 25 Martin Whitaker 2019-01-15 00:03:28 CET
Created attachment 10663 [details]
Screenshot from Live ISO boot menu (czech)
Comment 26 Martin Whitaker 2019-01-15 00:04:02 CET
Created attachment 10664 [details]
Screenshot from Live ISO boot menu (german)
Comment 27 Martin Whitaker 2019-01-15 00:04:32 CET
Created attachment 10665 [details]
Screenshot from Live ISO boot menu (slovenian)
Comment 28 Martin Whitaker 2019-01-15 00:05:00 CET
Created attachment 10666 [details]
Screenshot from Live ISO boot menu (swedish)
Comment 29 Martin Whitaker 2019-01-15 00:06:08 CET
Created attachment 10667 [details]
Screenshot from Live ISO boot menu (turkish)

I wish there was a way to attach multiple files in one go...
Comment 30 Martin Whitaker 2019-01-19 12:44:33 CET
I'll see what I can do with Fontforge.
Comment 31 Barry Jackson 2019-01-19 14:58:59 CET
Hi Martin, sorry I do not have time to look at this. Fontforge worked OK for me last time, however I forget the exact steps as it's a while ago. 

The original Mageia font was created by diogenese (on irc) who I don't think is around now.

It is a tedious job but once the process is worked out it gets easier as I recall!

Cheers,
Barry
Comment 32 Martin Whitaker 2019-01-20 19:13:54 CET
Hi Barry. Fontforge worked well, apart from one little quirk regarding setting the character width for new glyphs. Once I'd figured out the process, it all went smoothly. I've added the few missing glyphs in the Latin-1 Extension block, and all glyphs in the Latin Extended-A block. That should cover us for pretty much all modern Latin scripts.

I've also made a minor tweak to the maggy theme, to prevent the informational message overlapping the Mageia logo. Some translations are considerably longer than the English text.

Resolution: (none) => FIXED
Status: REOPENED => RESOLVED

Comment 33 Barry Jackson 2019-01-21 00:42:16 CET
That's great! Thanks for your efforts!
The theme may need tweaking again before release as it usually does when the new background is available due to the colours and positioning of the logo etc.
We will see ;)

Barry

Note You need to log in before you can comment on or make changes to this bug.