Fonts and graphics


The menu below is an example of what a plain grub4dos menu looks like.
The menu.lst is saved as a UTF.8 file in Notepad (not the normal ANSI format) and contains Russian and Chinese characters, but these do not display correctly as the fonts are not available in a normal menu.





Below we have the same menu, but we have loaded a special font file which allows us to display the Russian/Chinese characters as they appear in Notepad.
We have also used an 800x600 graphics mode, added a background and moved the menu entry positions.
Graphicsmode must be used for special fonts - they will not display in text mode.

The 800x600 bitmap used for the wallpaper in this example has a black bottom border and so the bottom of the menu is all black.

Here is the menu.lst file that was used for the above menu:

clear
debug off
# autonumber menu entries
write 0x8274 0x2001
set mode=graphicsmode -1 800  100:1000 24:32 > nul
set cmd=font /unifont.hex.gz
%mode%
%cmd%
splashimage /aurora24.bmp.gz > nul

# set the title text at the very top of the screen
set title= %mode%    %cmd%  

# set the colours we want to use
# Note: apart from highlighted text, any background colour is ignored as it will always be 'transparent' except for highlight setting
#0=black,1=blue, 2=green,3=cyan,4=red,5=magenta,6=brown,7=grey (add 8 for bright color - e.g. 15=white, 14=yellow, 13=pink,12=red,11=cyan,10=green, 9=bright blue, 8=grey)
#multiply by 16 to make the background blue (16x1), 32 to make the background green (16x2), 48 for bkgnd cyan (16x3), etc.
#     normal=grey, highlight=white+magenta helptext=pink, heading=cyan standard=white  boreder=red
color normal=0x07  highlight=0xf5          helptext=0x0D  heading=0x0A standard=0x0F   border=0x04

# display the heading and cover up grub4dos version text
write (md)0x220+1 !BAT\necho -n -P:0000 $[0133]       %title%        \0
initscript (md)0x220+1

# - MENU POSITION AND BORDER -
# wordspacing and linespacing normally set to 0, borderwidth=0 for no border, 1 for thin border, etc.
#/menusetting.gz u    will restore max menu grub4dos default
set wdspace=0
set lnspace=0
set topstart=8
set rstart=7
set noitems=5
set menuw=54
set bdwidth=1
set tophelp=23
# place a 5 entry menu at extreme right of 800x600 splashimage bitmap, starting 8 lines down, 7 across
/menusetting.gz   %wdspace% %lnspace% %bdwidth% %tophelp% %noitems% %topstart% %menuw% %rstart%

title Russian - понял что проблема с файлом меню\nThis will install any edition of Windows 32-bit to  your hard disk
reboot

title Chinese reboot (重启)
reboot

title Chinese halt (关机)
halt

The files required can be downloaded here.
Easy2Boot contains a selection of 0x20-0x7E fonts.

The font command

The font command without a parameter, loads the BIOS VGA ROM ASCII fonts for codes 0x20-0x7F.

You cannot load two fonts, one after the other, e.g. this does not load the roman.hex.gz font:
font /sans.hex.gz
# next line does NOT work!
font /roman.hex.gz

Instead, you have to use the font command to enable the loading of the second font...
font /sans.hex.gz
font
font /roman.hex.gz

Č
ċ
ď
Fonts800.zip
(1915k)
Steve Si,
3 Nov 2012 10:56