EFI Grub appears to use HEAVY box drawing characters, whilst Ubuntu Font only has Light ones

Bug #1768312 reported by Dimitri John Ledkov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Font Family
New
Undecided
Unassigned
fonts-ubuntu (Ubuntu)
Confirmed
Undecided
Unassigned
grub2 (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

This is a two-in-one bug report.

I'm trying to use UbuntuMono font in grub, and that does not look nice.

Specifically, box drawing characters (corner, hline, vline) appear to be used in their "heavy" variants, whilst UbuntuMono font only has "light" variants.

Reading the code, it appears that an attempt to re-map GRUB_UNICODE_HLINE to GRUB_UNICODE_LIGHT_HLINE is done, however it seems to not work.

Steps to reproduce:
grub-mkfont -v -v -s 64 -o my.pf2 \
 /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf
sudo cp my.pf2 /boot/grub/unicode.pf2
sudo cp my.pf2 /boot/grub/fonts/unicode.pf2

(Note the -v -v prints the glyphs, if one adds `| grep Glyph` there, one can see that the font has 0x2500 character the light horizontal line, but not 0x2501 which is a heavy one https://en.wikipedia.org/wiki/Box-drawing_character#Unicode)

Reboot and notice how everything is huge and Ubuntu Mono font, yet the frame around the menu is formed out of tiny characters that look like '?' in a diamond-like shape.

Next, using font-forge I've copied the "light" glyphs into the "heavy" ones, and exported font as .ttf, and regenerated the my.pf2 file, and installed it instead of the unicode.pf2 - and after rebooting everything started to work fine.

I'm not sure if grub is intentionally using "heavy" glyphs, or if remapping of characters from "heavy" to "light" is failing.

I'm not sure if "heavy" weight box drawing characters can be developed. However, I think it would be nice to make UbuntuMono font be compatible/usable as a grub font.

I am not capable of developing "heavy" weight box drawing characters in the Ubuntu Mono font, however, I hope it should be possible to binary patch the font and copy "light" glyphs into the "heavy" codepoints. Or somehow specify inside the truetype font that these glyphs should be used twice. Specifically:

0x2500 -> 0x2501
0x2502 -> 0x2503
0x250c -> 0x250f
0x2510 -> 0x2513
0x2514 -> 0x2517
0x2518 -> 0x251b
0x251c -> 0x2523
0x2524 -> 0x252b
0x252c -> 0x2533
0x2534 -> 0x253b
0x253c -> 0x254b

Note there are many more glyphs that allow for "mixing&matching" light/heavy, e.g. "UP HEAVY AND LEFT LIGHT", above copies would simply "fully-heavy" glyphs available, and rendered identical to the "fully-light" glyphs.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in fonts-ubuntu (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.