On Monday 22 September 2008 00:55, Michele Sanges wrote:
> Yann,
> thank you for the comments.

+#if ENABLE_FONTMAP_HARDCODED
static const char fontmap[95][12] = {
+ //space (32)
+{0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00,
+0x00},

I think one line per char would be better:

static const char fontmap[95][12] = {
+ //space (32)
+{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },



+0x00,
+0x00,
+0x00,
+0x00}};
+
+#else
+       static FILE *fontmap_fd = NULL;
+#endif
+#endif

Well, this forces you to handle FONTMAP_HARDCODED and not-HARDCODED
very differently. Can you just define a pointer to char[12]? -

+#else
static char (*fontmap)[12];
+#endif

Then you can just 
        fontmap = xzalloc(sizeof(fontmap[0]) * 95),

read font file into it, and use it exactly
as you would use FONTMAP_HARDCODED one.

Redraw code which restores picture when new text
is being printed is not elegant. Not that I have
an ideal solution either.

I think non-controversial initial version may be one which
simpy prints text WITHOUT restoring background.
Just overwriting pixels which form letters.

It will be more limited in functionality, yes.
We can decide how to do "clean" rewrites later.
It makes sense to start a thread about that
with conceptual description how you'd implement it.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to