LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-06-2022, 11:34 PM   #1
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 268

Rep: Reputation: 25
Question How to Convert font for grub ?


Hi there, i want to use the same ConsoleFont i had set up on my Slackware
/usr/share/kbd/consolefonts/Lat2-Terminus16.psfu.gz

On my Grub. i had made the follow

Code:
cp /usr/share/kbd/consolefonts/Lat2-Terminus16.psfu.gz /tmp
cd /tmp
gzip -d Lat2-Terminus16.psfu.gz
That give me the file
Code:
Lat2-Terminus16.psfu
But i can't use grub-mkfont
Code:
grub-mkfont /tmp/Lat2-Terminus16.psfu -o /usr/share/grub/Lat2-Terminus16.pf2
Quote:
can't open file /tmp/Lat2-Terminus16.psfu, index 0: error 2: unknown file format
Someone knows how i should do for convert the font to grub compatible format ?

Well, later i try this tool -> http://grub.gibibit.com/New_font_for...to-pff2-format

Last edited by inukaze; 08-07-2022 at 01:27 AM.
 
Old 08-07-2022, 02:05 AM   #2
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 268

Original Poster
Rep: Reputation: 25
Well i had found this package -> https://centos.pkgs.org/8/epel-x86_6...oarch.rpm.html
 
1 members found this post helpful.
Old 08-07-2022, 04:36 AM   #3
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,334

Rep: Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049Reputation: 4049
From what I see, input file must be a .ttf file, not a .psfu

Code:
blackstar:/tmp:# grub-mkfont -o DejaVuSans.pf2 /usr/share/fonts/TTF/DejaVuSans.ttf 
blackstar:/tmp:# file DejaVuSans.pf2 
DejaVuSans.pf2: GRUB2 font "DejaVu Sans Regular 16"
Code:
blackstar:/tmp:# grub-mkfont -o DejaVuSans.pf2 --size=24 /usr/share/fonts/TTF/DejaVuSans.ttf 
blackstar:/tmp:# file DejaVuSans.pf2                                                         
DejaVuSans.pf2: GRUB2 font "DejaVu Sans Regular 24"

Last edited by marav; 08-07-2022 at 04:37 AM.
 
3 members found this post helpful.
Old 08-07-2022, 06:35 AM   #4
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by inukaze View Post
Thanks inukaze.

These .pf2 fonts should be 'ready to use' for GRUB2

Below is the rpm package I found on your link.

The RHEL package terminus-fonts-grub2-4.48-1.el8.noarch.rpm may be worthy of an SBo Slackbuild !

I'll check it out.

Thanks for the new GRUB2 Fonts !

-- kjh


Code:
$ mkdir /tmp/fonts-rhel8-terminus
$ cd    /tmp/fonts-rhel8-terminus
$ wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/t/terminus-fonts-grub2-4.48-1.el8.noarch.rpm
$ rpm -qil -p terminus-fonts-grub2-4.48-1.el8.noarch.rpm

# -- output is --
warning: terminus-fonts-grub2-4.48-1.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
Name        : terminus-fonts-grub2
Version     : 4.48
Release     : 1.el8
Architecture: noarch
Install Date: (not installed)
Group       : Unspecified
Size        : 824799
License     : OFL
Signature   : RSA/SHA256, Mon Apr  6 15:41:30 2020, Key ID 21ea45ab2f86d6a1
Source RPM  : terminus-fonts-4.48-1.el8.src.rpm
Build Date  : Mon Apr  6 15:10:11 2020
Build Host  : buildvm-21.phx2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://terminus-font.sourceforge.net/
Bug URL     : https://bugz.fedoraproject.org/terminus-fonts
Summary     : Clean fixed width font (grub2 version)
Description :

The Terminus Font is designed for long (8 and more hours per day)
work with computers.

It covers about 120 language sets and supports ISO8859-1/2/5/7/9/13/15/16,
Paratype-PT154/PT254, KOI8-R/U/E/F, Esperanto, and many IBM, Windows and
Macintosh code pages, as well as the IBM VGA, vt100 and xterm pseudo
graphic characters.

The sizes present are 6x12, 8x14, 8x16, 10x20, 11x22, 12x24, 14x28 and 16x32.
The styles are normal and bold (except for 6x12),
plus EGA/VGA-bold for 8x14 and 8x16.

The font is available for the Linux console and for X11.

This package contains the fonts to use with the grub2 boot loader.
/usr/share/doc/terminus-fonts-grub2
/usr/share/doc/terminus-fonts-grub2/README
/usr/share/doc/terminus-fonts-grub2/README-BG
/usr/share/grub/ter-u12b.pf2
/usr/share/grub/ter-u12n.pf2
/usr/share/grub/ter-u14b.pf2
/usr/share/grub/ter-u14n.pf2
/usr/share/grub/ter-u16b.pf2
/usr/share/grub/ter-u16n.pf2
/usr/share/grub/ter-u18b.pf2
/usr/share/grub/ter-u18n.pf2
/usr/share/grub/ter-u20b.pf2
/usr/share/grub/ter-u20n.pf2
/usr/share/grub/ter-u22b.pf2
/usr/share/grub/ter-u22n.pf2
/usr/share/grub/ter-u24b.pf2
/usr/share/grub/ter-u24n.pf2
/usr/share/grub/ter-u28b.pf2
/usr/share/grub/ter-u28n.pf2
/usr/share/grub/ter-u32b.pf2
/usr/share/grub/ter-u32n.pf2
 
1 members found this post helpful.
Old 08-07-2022, 06:56 AM   #5
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
inukaze --

I made a clean Slackware Package from terminus-fonts-grub2-4.48-1.el8.noarch.rpm like this:
Code:
# /usr/bin/rpm2txz terminus-fonts-grub2-4.48-1.el8.noarch.rpm
Which gave me a Slackware Package:
Code:
# ls -la terminus-fonts*

-rw-r--r--  1 root   root  183632 Apr  6  2020 terminus-fonts-grub2-4.48-1.el8.noarch.rpm
-rw-r--r--  1 root   root  154740 Aug  7 06:43 terminus-fonts-grub2-4.48-1.el8.noarch.txz
text deleted

OMG ! a .pcf font is not a .pf2 font !

I installed rhel8 terminus-fonts-grub2-4.48-1.el8.noarch.txz via installpkg terminus-fonts-grub2-4.48-1.el8.noarch.txz

which gave me these new fonts in /usr/share/grub/
Code:
# ls -la /usr/share/grub/
-rw-r--r--   1 root root  32398 Apr  6  2020 ter-u12b.pf2
-rw-r--r--   1 root root  32397 Apr  6  2020 ter-u12n.pf2
-rw-r--r--   1 root root  36540 Apr  6  2020 ter-u14b.pf2
-rw-r--r--   1 root root  35275 Apr  6  2020 ter-u14n.pf2
-rw-r--r--   1 root root  37208 Apr  6  2020 ter-u16b.pf2
-rw-r--r--   1 root root  35767 Apr  6  2020 ter-u16n.pf2
-rw-r--r--   1 root root  41003 Apr  6  2020 ter-u18b.pf2
-rw-r--r--   1 root root  39480 Apr  6  2020 ter-u18n.pf2
-rw-r--r--   1 root root  41949 Apr  6  2020 ter-u20b.pf2
-rw-r--r--   1 root root  40161 Apr  6  2020 ter-u20n.pf2
-rw-r--r--   1 root root  45779 Apr  6  2020 ter-u22b.pf2
-rw-r--r--   1 root root  43484 Apr  6  2020 ter-u22n.pf2
-rw-r--r--   1 root root  49221 Apr  6  2020 ter-u24b.pf2
-rw-r--r--   1 root root  47018 Apr  6  2020 ter-u24n.pf2
-rw-r--r--   1 root root  56899 Apr  6  2020 ter-u28b.pf2
-rw-r--r--   1 root root  56697 Apr  6  2020 ter-u28n.pf2
-rw-r--r--   1 root root  66695 Apr  6  2020 ter-u32b.pf2
-rw-r--r--   1 root root  63406 Apr  6  2020 ter-u32n.pf2
Any of these should be usable in /etc/default/grub instead of /boot/grub/fonts/DejaVuSansMono36.pf2

Code:
GRUB_FONT=/boot/grub/fonts/DejaVuSansMono36.pf2
I would be inclined to copy the font from /usr/share/grub/ to /boot/grub/fonts/ so it's available early in the boot process ...
HTH

-- kjh

Last edited by kjhambrick; 08-07-2022 at 07:25 AM. Reason: OMG ! pcf is NOT pf2 !
 
Old 08-07-2022, 08:02 AM   #6
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
inukaze --

The following procedure worked for me on Slackware64 15.0 ...

I installed the rhel8 GRUB2 fonts as root ; copied a pair into /boot/grub/fonts/ ; edited /etc/default/grub and changed the font ; ran grub-mkconfig

Rebooted and I ended up with the new 32-pt terminus font ...

HTH

-- kjh

EDIT: P.S. I found a comment in my /etc/default/grub file: Viet's Blog - Make Grub Font Size Bigger which describes how I made my 36-point DejaVuSansMono36.pf2 font for GRUB2 ( after translating Ubuntese into Slackware )

tl;dnr
Code:
# log in as root ; make a working directory ; go there and get the rpm file you showed me:
su -                           
mkdir /tmp/fonts-rhel8-terminus
cd    /tmp/fonts-rhel8-terminus
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/t/terminus-fonts-grub2-4.48-1.el8.noarch.rpm

# make a slackware package from the .rpm file:
/usr/bin/rpm2txz terminus-fonts-grub2-4.48-1.el8.noarch.rpm

# check my work:
ls -la 

# output is ( ignoring leading #-chars )
# -rw-r--r--  1 root   root  183632 Apr  6  2020 terminus-fonts-grub2-4.48-1.el8.noarch.rpm
# -rw-r--r--  1 root   root  154740 Aug  7 06:43 terminus-fonts-grub2-4.48-1.el8.noarch.txz

# install the package:
installpkg terminus-fonts-grub2-4.48-1.el8.noarch.txz

# these are the new fonts:
ls -la /usr/share/grub/*.pf2

# output is ( withour leading #-char )
# -rw-r--r--   1 root root  32398 Apr  6  2020 ter-u12b.pf2
# -rw-r--r--   1 root root  32397 Apr  6  2020 ter-u12n.pf2
# -rw-r--r--   1 root root  36540 Apr  6  2020 ter-u14b.pf2
# -rw-r--r--   1 root root  35275 Apr  6  2020 ter-u14n.pf2
# -rw-r--r--   1 root root  37208 Apr  6  2020 ter-u16b.pf2
# -rw-r--r--   1 root root  35767 Apr  6  2020 ter-u16n.pf2
# -rw-r--r--   1 root root  41003 Apr  6  2020 ter-u18b.pf2
# -rw-r--r--   1 root root  39480 Apr  6  2020 ter-u18n.pf2
# -rw-r--r--   1 root root  41949 Apr  6  2020 ter-u20b.pf2
# -rw-r--r--   1 root root  40161 Apr  6  2020 ter-u20n.pf2
# -rw-r--r--   1 root root  45779 Apr  6  2020 ter-u22b.pf2
# -rw-r--r--   1 root root  43484 Apr  6  2020 ter-u22n.pf2
# -rw-r--r--   1 root root  49221 Apr  6  2020 ter-u24b.pf2
# -rw-r--r--   1 root root  47018 Apr  6  2020 ter-u24n.pf2
# -rw-r--r--   1 root root  56899 Apr  6  2020 ter-u28b.pf2
# -rw-r--r--   1 root root  56697 Apr  6  2020 ter-u28n.pf2
# -rw-r--r--   1 root root  66695 Apr  6  2020 ter-u32b.pf2
# -rw-r--r--   1 root root  63406 Apr  6  2020 ter-u32n.pf2

# pick a font for grub ( I am using a 36-point font so I picked the 32-point terminus font )
cp -p /usr/share/grub/ter-u32?.pf2 /boot/grub/fonts/

# check my work:
ls -la /boot/grub/fonts/

# output is ( ignore leading #-chars )
# total 384
# drwxr-xr-x 2 root root   4096 Aug  7 07:31 ./
# drwxr-xr-x 6 root root   4096 Aug  7 07:32 ../
# -rw-r--r-- 1 root root 246373 Nov 14  2021 DejaVuSansMono36.pf2
# -rw-r--r-- 1 root root  66695 Apr  6  2020 ter-u32b.pf2
# -rw-r--r-- 1 root root  63406 Apr  6  2020 ter-u32n.pf2

# edit /etc/default/grub ; change fonts ; save 
vim /etc/default/grub     # changed GRUB_FONT=/boot/grub/fonts/DejaVuSansMono36.pf2
                          # to      GRUB_FONT=/boot/grub/fonts/ter-u32n.pf2

# run grub-mkconfig
grub-mkconfig -o /boot/grub/grub.cfg

# no errors but ...

# check /boot/grub/grub.cfg -- new font is now referenced:

less /boot/grub/grub.cfg
<<<snip>>>
if loadfont /boot/grub/fonts/ter-u32n.pf2 ; then
  set gfxmode=1920x1080x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
<<snip>>

# reboot
shutdown -r now

Last edited by kjhambrick; 08-07-2022 at 08:09 AM. Reason: p.s. add a link
 
1 members found this post helpful.
  


Reply

Tags
font, grub 2, slackware 14.2/x86_64


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert grub 1 commands format to grub 2 style format marietto2008 Linux - Newbie 2 07-09-2020 11:45 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
GRUB GRUB GRUB GRUB "Whats Going on?" Gaweph Linux - Newbie 6 03-26-2004 10:40 AM
Font name from font files ngomong Linux - Software 0 05-09-2002 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration