Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom theme fonts
Playing around with Ventoy and themes I found that the theme fonts (or custom fonts I create) are not loaded unless I add the to the EFI partition under grub/fonts and then edit grub.cfg and add them in using loadfonts.  I'm no grub expert so maybe there is a better way to to do this that is more dynamic?  Or is this a feature request to be something that is configurable in the theme object in ventoy.json?
can you try this file
To give an example: 

I'm trying out the custom themes and am working with  It has a custom grub font fixedsys-regular-32.pf2 that is part of the theme and is distributed in the theme folder.  However, the provided font does not get loaded and the font defaults to the only font specified in the grub/grub.cfg in the EFI partition as 'loadfont ascii' (grub/fonts/ascii.pf2)  Adding fixedsys-regular-32.pf2 to grub/fonts/ on the EFI partition and loading it with an additional loadfont line resolves the issue.  (ascii.pf2 is not missing).  It may be that how grub is being rebuilt after adding the theme that it is not adding the font to the conf.

Sidenote: for anyone who wants to try out fallout-grub-theme, it works great, just a couple tips: the included font is too large (32).  To address this simply build a new font, follow the above (until there is an alternative), and update the theme.txt. 

Font source:

How to convert a font for use with grub:

I built one for normal menu and one for when highlighted:

grub-mkfont -o fixedsys-ligatures.pf2 -s 16 fixedsys-ligatures.ttf

grub-mkfont -o fixedsys-ligatures_bold.pf2 -s 16 -b fixedsys-ligatures.ttf

I made did some other small tweaks that I can share if anyone is interested.
(05-26-2020, 03:33 PM)PlumberOfSound Wrote: I made did some other small tweaks that I can share if anyone is interested.

I'd be interested in your completed version of this Wink, as I can't be bothered fiddling about with fonts etc Big Grin Thx.
I open a bug for this bug with a example for a solution
I have added it to the plan of 1.0.14.

Forum Jump:

Users browsing this thread: 1 Guest(s)