Wednesday 13 May 2020

New large font theme for agFM (and discovery of a bug in grub2 themes)

I was experimenting with some grub2 themes yesterday (to use a large font for partially sighted users) and I wanted to create a menu which had a different theme.

However, I noticed a strange problem - sometimes one icon would be missing from the menu list!


This was not a problem due to the large font used because the same issue occurred with the standard small unifont pf2 file.

I noticed this issue because the theme I was testing (hitman) did not use a desktop-image file but instead it used a image object to display the image:

+ image {
id = "logo"
top = 18%
left = 25%
width = 50%
height = 45%
file = "ica-logo.jpeg"
visible = "false"
}

As soon as I used the Up or Down cursor key, the missing icon would be drawn correctly however.

After a LOT of experimenting and comparing with other themes which seemed to work perfectly, I found that the bug only appeared if you did not define a 'desktop-image: "xxxx.jpeg"' in the theme .txt file. 

The new theme is called seven14Large because it uses a large font and the 'seven' jpeg as the centre image, but you can easily change the image. It fits on 14 entries per screen and includes a scroll bar.

seven14Large - user menu

seven14Large - agFM menu (scroll bar on right)

Instructions are in the README.txt file if you want to try it.

Copy the seven14Large folder to \boot\grubfm\themes

Add the line:
loadfont (${user})/boot/grubfm/themes/seven14Large/unicode-large.pf2
to your /boot/grubfm/startup_menu.txt file (this may not be necessary in agFM v2.06 or later as it can automatically load the .pf2 font files from the user's theme folder).

and change the menu to seven14Large:
set mymenu=1
set mytheme="seven14Large"

The other annoying 'gotcha' with grub2 themes is that the scroll bar only appears if you specify a menu_pixmap_style set of bitmaps - e.g.

menu_pixmap_style = "menu_bkg_*.png" 

so this means if you want a scrollbar, you have to use a background of  this type.


Repro the bug

If you want to test the missing icon bug for yourself, just comment out the desktop-image entry in the fm.txt menu file as shown below (in red) and then navigate to a folder which has a lot of entries - often one of them will be missing!:

# Global Property
title-color: "#ffffff"
title-text: "Easy2Boot agFM"
message-color: "#FFFFFF"
message-bg-color: "#000000"
desktop-color: "#000000"
#desktop-image: "black.jpeg"
terminal-box: "term_bkg_*.png"
desktop-image-scale-method: "stretch"



P.S. This bug should be fixed in agFM v1.51 (a1ive has fixed it)

Also Atomic theme is available...



1 comment: