From time to time while writing scripts, I've found myself wishing for a way to display text on the camera's LCD in a larger font. Something that can be read from several feet away ( at least ). It doesn't take a lot of imagination to find situations where this could be very useful.
I took a look at the underlying code for the Lua text display function
draw_string() and quickly came to the conclusion that the code was not written with any thought to allowing the user to specify fonts or font sizes. Changing that looks like a really big job !
So I decide to write a Q&D (quick & dirty) routine to let you display text in various font sizes. I ended up with a C language patch file for the existing CHDK trunk and a Lua-only routine to do much the same thing. I'll admit right here that my code does not let you specify the font face and it does not do proportional spacing, kerning, decenders, font hinting, anti-aliasing, or anything else fancy. Its just a way to put up a BIG message on the screen for those situations where you really need a big message - ugly fonts or otherwise. The image below show the displayed text in various user specified font sizes and colors.
The new function is called
draw_big_chars( xpos, ypos , text_string , fg_color , bg_color , font_size ). draw_big_chars( 45, 15,"SMALL",258,259, 1)
draw_big_chars( 25, 30,"MEDIUM",271,266, 6)
draw_big_chars( 35, 90,"BIG",270,262, 12)
The attached zip file has a patch file to add code to Lua to make this a built-in function, a test script for that new function, and it also has a Lua only version of the function that will work with any current version of CHDK.
Can this be improved? Absolutely! But working code is 100x better than good intentions so I'll post it here for anyone to enjoy.