> Paul, for rotated fonts, I was actually thinking that it > would be > better to just make a new font for them. for example, > instead of a 5x8 > font, you would have a 8x5 (90 degree) font & font > array. These fonts > should be named accordingly. I think this would save memory > for those > who only wish to use fonts in one direction only, which is > usually the > case.
I've been thinking about font orientation also. We would definitely save memory by arranging the letters, so that they are stored in that direction where bytes are filled best. 127 characters of 5x8 use 127*5=635 bytes, while 127 characters of 8x5 use 127*8=1016 bytes with a lot of unused bits. A good algorithm would be needed to rotate the chars if needed. There is no easy way (i know of) to do that. A little sketch of what I presume the most efficient way... var byte char_start, char_size -- missing: set char_start and char_size to the appropriate values var byte char_90deg[8] -- this sketch is for 8x8 font maximum var byte*8 char_90deg_large_number at char_90deg var byte char_pixline char_90deg_large_number=0 for char_size using line_counter loop -- shifting a large number is more efficient than shifting eight single -- bytes char_90deg_large_number=char_90deg_large_number<<1 char_pixline=fontlookup[char_start+line_counter] -- this looks terrible, but constant indexes are very efficient. -- each line could compile to just two words of code char_90deg[0]=char_90deg[0] | (char_pixline & 1) char_90deg[1]=char_90deg[1] | (char_pixline & 2) char_90deg[2]=char_90deg[2] | (char_pixline & 4) char_90deg[3]=char_90deg[3] | (char_pixline & 8) char_90deg[4]=char_90deg[4] | (char_pixline & 16) char_90deg[5]=char_90deg[5] | (char_pixline & 32) char_90deg[6]=char_90deg[6] | (char_pixline & 64) char_90deg[7]=char_90deg[7] | (char_pixline & 128) end loop I think this should neither use up the aforementioned difference between 5x8 and 8x5 fonts, nor should it take terribly long to execute. Greets, Kiste -- 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.
