Problem with struct font_misc_info

Alexander Thoukydides alex at thouky.co.uk
Sun Feb 24 15:06:21 GMT 2002


OSLib defines the miscellaneous font metrics information structure (returned
by Font_ReadFontMetrics) as:

    struct font_misc_info
       {  short x0;
          short y0;
          short x1;
          short y1;
          short xkern;
          short ykern;
          short italic_correction;
          byte underline_position;
          byte underline_thickness;
          short cap_height;
          short xheight;
          short descender;
          short ascender;
          int reserved;
       };

However, (at least on my RISC OS 4.03 machine) I get the following returned:

    struct font_misc_info
        { int x0;
          int y0;
          int x1;
          int y1;
          int xkern;
          int ykern;
          int italic_correction;
          byte underline_position;
          byte underline_thickness;
          // Two unused bytes here
          int cap_height;
          int xheight;
          int descender;
          int ascender;
          int reserved;
        };

i.e. a 52 byte block rather than a 28 byte one.

The OSLib definition does appear to match that specified in the PRMs (3-478),
but that isn't terribly helpful when the font manager returns something
different.

Preumably, either the PRM information was always wrong, or (more likely) the
behaviour changed in a later release of RISC OS. I'm guessing that someone
working on the font manager changed an internal data structure to improve
efficiency and didn't realise the knock-on effects.

Either way, any chance of a second data structure being added to OSLib to
match the current behaviour?

Alex
-- 
--  Alexander Thoukydides  Email: mailto:alex at thouky.co.uk
--  Cambridge, England       WWW: http://www.thouky.co.uk/
--  "Yeah, but you're taking the universe out of context."



More information about the oslib-user mailing list