nanogui: Fonts offset leads to wrong memory location -- genfont.c bug??


Previous by date: 22 Nov 2006 20:03:59 +0000 Re: Building flnx for embedded powerpc?, Greg Haerr
Next by date: 22 Nov 2006 20:03:59 +0000 Re: Fonts in nano-X, nxlib, FLTK, Greg Haerr
Previous in thread: 22 Nov 2006 20:03:59 +0000 Re: Fonts offset leads to wrong memory location -- genfont.c bug??, Ricardo P. Jasinski
Next in thread:

Subject: Re: [nanogui] Fonts offset leads to wrong memory location -- genfont.c bug??
From: "Greg Haerr" ####@####.####
Date: 22 Nov 2006 20:03:59 +0000
Message-Id: <185201c70e71$5788e0b0$0300a8c0@RDP>

: : As can be seen, when pf->offset is treated as an unsigned long, it is
: indexed at 4 bytes
: increments, placing the pointer at the wrong location. Also, the value
: retrieved is 4 bytes
: long, which results in an abnormally huge offset value.
:
: Casting pf->offset to an unsigned short *, the pointer is positioned
: corrrectly at 2 bytes
: increments, and retrieved offset values are 16-bit, giving back the
correct
: values from the
: font offsets table {0, 13, 26, etc.}.
:
: As a test, I have recompiled the original microwindows code, simply
changing
: pf->offset type
: from 'unsigned long *' to 'MWIMAGEBITS *'. Apparently, everything ran
: smoothly.

It's been so long since I wrote the windows font conversion
utility I forgot how it worked.  I think the bug is that
the font conversion utility spits out an incorrectly
declared offset array: its using unsigned shorts, and should
be declared unsigned long, since Microwindows was changed
to allow larger font offsets after the font conversion utility
was written.

Try changing the declaration of the offset table in the .c file
produced, that'll fix it, right?

Regards,

Greg



Previous by date: 22 Nov 2006 20:03:59 +0000 Re: Building flnx for embedded powerpc?, Greg Haerr
Next by date: 22 Nov 2006 20:03:59 +0000 Re: Fonts in nano-X, nxlib, FLTK, Greg Haerr
Previous in thread: 22 Nov 2006 20:03:59 +0000 Re: Fonts offset leads to wrong memory location -- genfont.c bug??, Ricardo P. Jasinski
Next in thread:


Powered by ezmlm-browse 0.20.