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)
But working code is 100x better than good intentions so I'll post it here for anyone to enjoy.
I decide to write a Q&D (quick & dirty) routine to let you display text in various font sizes.
There are also a few suggestions in the SDM source code: http://trac.assembla.com/chdkde/browser/branches/SDM/core/draw_palette.c#L411
--[[ @title Big Font--]]stretch = 4for size= 1, 10 do for count = 0, 10 do draw_big_chars( 1, 20,"ABC",258,259, size , stretch) sleep(100) end if ( size ==4 ) then stretch=3 endend
Here's a version that uses the built-in font data instead of adding another font.
But wouldn't it be better just add such functions to drawings module, instead of pushing them to lua itself?
Putting it into the drawing module is probably the best way to avoid increasing the size of the installed CHDK image if the script doesn't need/use the function. However, I don't believe that would allow philmoz's trick of using the currently installed font - which has much more resolution than the font file I found online.Update : maybe a good compromise is a small Lua function that just returns the address of the current font bitmap so that the rest of the code can be in the drawing module?
I think outslider and msl meant to put the function in gui_draw.c rather than luascript.c
By using the built-in font the function becomes quite small so it won't add much to the core CHDK size.I'd suggest adding two new functions to gui_draw.c - 'draw_char_scaled' and 'draw_string_scaled' to be consistent with the current draw_char and draw_string functions.
Note: this will still only use the built-in font, it won't allow scaled rendering of the RBF fonts.
... msl meant to put the function in gui_draw.c rather than luascript.c
Started by linuxGuy
« 1 2 3 »
Started by kajakazik
Started by frank
Started by ixussuxi
General Help and Assistance on using CHDK stable releases
Started by Pelican
DSLR Hack development