FS#12336 - virtual keyboard spacing problem with custom keyboard and multifont theme

Attached to Project: Rockbox
Opened by Michael Chicoine (mc2739) - Monday, 17 October 2011, 13:30 GMT
Last edited by Fred Bauer (freddyb) - Saturday, 22 October 2011, 19:49 GMT
Task Type Bugs
Category Themes
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Urgent
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The virtual keyboard spacing is incorrect when using a custom loadable keyboard layout along with a theme which loads multiple fonts. The spacing of the virtual keyboard appears to be based on the largest font loaded, not the user interface font.

The first build that this behavior is noticeable is r30716, but that is not necessarily the failing build. With builds between r30589 and r30715, bringing up the virtual keyboard with a custom keyboard layout causes a data abort. The last build that works properly is r30588.

This is failure can be reproduced in the uisimulator.

Steps to reproduce:
1. Add a custom keyboard file to your .rockbox directory ( is the default keyboard as a .kbd file)
2. Go to your .rockbox directory and "play" the file.
3. Bring up the virtual keyboard (i.e. rename a file) and notice the character spacing.
4. Load a theme which uses multiple fonts - you can modify the cabbiev2.wps file to load an additional larger font by adding a line such as:


Make sure that font exists in your .rockbox/fonts directory. Also, change one of the viewport definitions to use the new font. Use a font which is large enough to be noticeable.
5. Bring up the virtual keyboard again. The spacing on the virtual keyboard has changed to match the size of the larger font which was loaded instead of the user interface font.

I have attached screendumps taken from the e200 sim. The correct.bmp screendump is using the default.kbd and an unmodified cabbiev2. The incorrect.bmp screendump has a cabbiev2 with the above %Fl line added and one viewport modified to use font number 2.
This task depends upon

Closed by  Fred Bauer (freddyb)
Saturday, 22 October 2011, 19:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in r30826.
Comment by Michael Chicoine (mc2739) - Monday, 17 October 2011, 14:46 GMT
This task may be related to  FS#12306 
Comment by Fred Bauer (freddyb) - Saturday, 22 October 2011, 08:53 GMT
Can you try this? It adds some code to track which font is FONT_UI. It seems to fix my v-keyboard and lrcplayer.
Comment by Michael Chicoine (mc2739) - Saturday, 22 October 2011, 14:22 GMT

This patch looks good to me. After a quick test, both the virtual keyboard (and lrcplayer -  FS#12306 ) seem to work properly.