From e097d633220a415704f1c1f5e654f4eccc83e9ac Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Fri, 1 Jan 2016 17:51:00 +0100 Subject: Generate our own Grub font files, to fix the bad font rendering at UEFI boot. Slackware's shipped Grub font is 19 point in size which does not scale well. Research and proposed patch by Didier Spaier. --- EFI/BOOT/theme/dejavusansmono.pf2 | Bin 121271 -> 0 bytes EFI/BOOT/theme/liveslak.txt | 6 +++--- grub.tpl | 4 +++- make_slackware_live.sh | 10 +++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) delete mode 100644 EFI/BOOT/theme/dejavusansmono.pf2 diff --git a/EFI/BOOT/theme/dejavusansmono.pf2 b/EFI/BOOT/theme/dejavusansmono.pf2 deleted file mode 100644 index 008acd4..0000000 Binary files a/EFI/BOOT/theme/dejavusansmono.pf2 and /dev/null differ diff --git a/EFI/BOOT/theme/liveslak.txt b/EFI/BOOT/theme/liveslak.txt index d11a5b1..ec2bcf9 100644 --- a/EFI/BOOT/theme/liveslak.txt +++ b/EFI/BOOT/theme/liveslak.txt @@ -7,7 +7,7 @@ #title-text: "GRUB Slackware Live Edition" title-text: "" #title-font: "Unknown Regular 16" -title-font: "DejaVu Sans Mono 10" +title-font: "DejaVu Sans Mono Bold 12" title-color: "#5569B9" desktop-image: "/EFI/BOOT/theme/swlogog.png" desktop-color: "#000000" @@ -19,7 +19,7 @@ desktop-color: "#000000" width = 70% height = 45% #item_font = "Unknown Regular 16" - item_font = "DejaVu Sans Mono 10" + item_font = "DejaVu Sans Mono Bold 12" item_color = "lightgrey" selected_item_color = "red" item_height = 15 @@ -36,7 +36,7 @@ desktop-color: "#000000" top = 85% height = 5 #font = "Unknown Regular 16" - font = "DejaVu Sans Mono 5" + font = "DejaVu Sans Mono Regular 5" text_color = "red" fg_color = "#5569B9" bg_color = "#000000" diff --git a/grub.tpl b/grub.tpl index cfecd04..9652ff2 100644 --- a/grub.tpl +++ b/grub.tpl @@ -27,7 +27,9 @@ fi # Determine whether we can show a graphical themed menu: insmod font -if loadfont $grubdir/theme/dejavusansmono.pf2 ; then +if loadfont $grubdir/theme/dejavusansmono12.pf2 ; then + loadfont $grubdir/theme/dejavusansmono10.pf2 + loadfont $grubdir/theme/dejavusansmono5.pf2 set gfxmode=auto,640x480 export gfxmode # (U)EFI requirement: must support all_video: diff --git a/make_slackware_live.sh b/make_slackware_live.sh index aaeec27..043e590 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -587,7 +587,7 @@ fi # Are all the required add-on tools present? PROG_MISSING="" -for PROGN in mksquashfs unsquashfs syslinux mkisofs installpkg upgradepkg keytab-lilo ; do +for PROGN in mksquashfs unsquashfs grub-mkfont syslinux mkisofs isohybrid installpkg upgradepkg keytab-lilo ; do if ! which $PROGN 1>/dev/null 2>/dev/null ; then PROG_MISSING="${PROG_MISSING}-- $PROGN\n" fi @@ -1315,6 +1315,14 @@ fi mkdir -p ${LIVE_STAGING}/EFI/BOOT cp -a ${LIVE_TOOLDIR}/EFI/BOOT/{grub-embedded.cfg,make-grub.sh,osdetect.cfg,theme} ${LIVE_STAGING}/EFI/BOOT/ +# Create the grub fonts used in the theme: +for FSIZE in 5 10 12; do + grub-mkfont -s ${FSIZE} -bav \ + -o ${LIVE_STAGING}/EFI/BOOT/theme/dejavusansmono${FSIZE}.pf2 \ + /usr/share/fonts/TTF/DejaVuSansMono.ttf \ + | grep "^Font name: " +done + # The grub-embedded.cfg in the bootx64.efi looks for this file: touch ${LIVE_STAGING}/EFI/BOOT/${MARKER} -- cgit v1.2.3