Ventoy Forums
Custom theme fonts - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: Custom theme fonts (/showthread.php?tid=46)



Custom theme fonts - PlumberOfSound - 05-26-2020

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?


RE: Custom theme fonts - awengers44 - 05-26-2020

@PlumberOfSound
can you try this file

https://yadi.sk/d/6ScG7kbjaDgeBA


RE: Custom theme fonts - PlumberOfSound - 05-26-2020

To give an example: 

I'm trying out the custom themes and am working with https://github.com/shvchk/fallout-grub-theme.  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: https://www.download-free-fonts.com/details/91888/fixedsys-excelsior

How to convert a font for use with grub: http://wiki.rosalab.ru/en/index.php/Grub2_theme_tutorial#Font_creation_guide

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

Code:
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.


RE: Custom theme fonts - scaramonga - 05-28-2020

(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.


RE: Custom theme fonts - thomas - 06-22-2020

I open a bug for this bug with a example for a solution

https://github.com/ventoy/Ventoy/issues/245


RE: Custom theme fonts - longpanda - 06-22-2020

I have added it to the plan of 1.0.14.
https://github.com/ventoy/Ventoy/issues/243