Looks great, good work! I wonder if builk read/modify/write would be faster, but of course takes a lot more ram. For a 16x24 font, you may need about 48 bytes. Depending on how happy you are with visible speed, it may or may not be worth trying.
I'm actually interested in knowing how fast you can draw text compaired to mine. I have a USE_BLOCK_WRITE constant in my sample that enables/disables pixel by pixel. When using block writes, only one font bit direction can be used and I can't draw all fonts. Instead, I must make fonts with the correct bit direction. I feel this really is the best solution to keep speed. In the future, hopefully we have more fonts to choose from anyways, or even a program to convert our font tables :) I do suggest you use a constant like this so the user has a choice, if required. -- Using block write is fastest, but you can only use one font type: -- FONT_TOP_LEFT_HORIZONTAL const GLCD_USE_BLOCK_WRITE = TRUE include glcd_stm032qvt_003 stm_glcd_init() What font did you use in that image? Matt. On Dec 3, 11:06 am, Rob Hamerling <[email protected]> wrote: > Hi Matt, > > On 11/30/11 04:14 am, mattschinkel wrote: > > > You should be able to draw any size text, however if you are not on > > the 8 pixel boundary, you will need to read, modify then write the > > pixels. Still should be efficient enouf, but a note in the lib can let > > the user know what size fonts are best. Sounds like you will need a > > custom procedure for drawing text. Hopefully someone can implement > > this for other font sizes, but it would take some work. > > Yes an interesting puzzle! But I think I'm close to a solution, at least > for a maximum 8 pixels high font. I can now draw text on any position, > not limited to the fixed 8 text lines (pages) like in the current > implementation. When the y-coordinate of a char is on page boundary I > take the short way: only one write, for page-crossing characters I need > 2 read-modify-write cycles for 8 (vertical) pixels each. But I think > this is still more efficient than writing pixel-by-pixel. See attached > picture for a functional proof. > I need to do some cleanup of the code before committing. > > Regards, Rob. > > -- > R. Hamerling, Netherlands ---http://www.robh.nl > > ks0108b.jpg > 57KViewDownload -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
