Monday, 25 November 2013

Changing the font in Easy2Boot

Note: Thanks to Wonko from, I have been able to generate some alternative font files for the ASCII character set (0x20-0x7e). The next version of E2B will have these fonts available in the \_ISO\docs\Fonts folder. 

The character after !" is the £ (0x00A3) character which is loaded by the unifont.hex.gz full font file.
If no font is loaded then £ is displayed as a 'ooA3' as small characters from the BIOS font. Most fonts display the 00A3 character as รบ.

These fonts only contain characters 0x20-0x7E, but unifont.hex.gz contains all unicode characters including the A3 (£) font.

grub4dos only supports 8x8 of 8x16 dot matrix fonts. This means that we are limited in the size of the characters and the amount of  detail we can show. Hence complex fonts and italic fonts do not display well. If you visit the E2B Tutorial webpage, you can follow the instructions to make your own character fonts.
You can view your E2B menu in any of the new E2B pre-made fonts, copy the file \_ISO\docs\Fonts\$FontTest.mnu to the \_ISO\MAINMENU folder. You should see this menu:

When you select one of these, it will change the menu font to the one you selected.

unifont.hex.gz is the default E2B font.

BIOS is the font you will get if no font file is loaded or if you set BIOSFONT=1 in your MyE2B.cfg file.
To set the font to use any of the others, simply specify the path and filename in your MyE2B.cfg file, e.g.
set FONT=()/_ISO/docs/Fonts/sans2.uni.gz

E2B will always load the unifont.hex.gz file first to ensure that non-Latin characters like Chinese glyphs will be displayed correctly (unless NOUNIFONT=1 is specified). Then another font will be loaded over the top of unifont.hex.gz if you have specified one using the FONT variable. If you have set BIOSFONT=1 then the BIOS font will be used for characters 0x20-0x7F.

Therefore, if you specify a FONT= to be loaded, the full unifont.hex.gz font will be loaded, then E2B will load the BIOS fonts for the 0x20-0x7F characters and then it will load the specified user font (which contains characters 0x20-0x7E if you use the E2B font files provided).

The unifont.hex.gz file contains hundreds of glyphs for many different languages and is approx. 1MB in size. If your menu does not use these (i.e. you use a 'Latin/Roman' character set for your language) then you can set NOUNIFONT=1 in MyE2B.cfg and it won't load the large unifont.hex.gz file and thus will save a second or two in boot time.

This functionality will be in v1.18 which will be released as soon as the new grub4dos version with a few font code fixes is released by chenall.

Some more fonts that are included in E2B v1.18 are displayed here. You can display all the fonts by running /_ISO/docs/Fonts/ShowFonts.g4b from the grub4dos command line.