Re: Desklib + System Font = Bug?
- From: Steve Fryatt <news@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Sep 2006 22:05:38 +0100
On 5 Sep, Adam wrote in message
<8117c5614e.admin@xxxxxxxxxxxxxxxx>:
I've had a bug report from someone who uses the system font (RO 4) as
their wimp font and my program is throwing a wobbly.
I've replicated it here (RO 4.39) and appear to have tracked it down
to the Desklib calls - for instance:
font_handle handle;
font_info info;
Font_GetWimpFont(&handle);
Font_ReadInfo(handle, &info);
...produces gobbledegook in info.miny and info.maxy when the system
font is in use (so my redraw routine goes haywire).
Have I done something wrong, or is there a problem with Desklib?
I'm not familiar with Desklib, but shouldn't you be checking the font
handle returned by Font_GetWimpFont() and treating the System Font as a
special case? That's certainly how you would have to do it otherwise.
If all you're doing is plotting text to a window (I'm guessing that this
is MimeMam), then consider either:
1) Using Wimp_PlotIcon and suitable dummy icon definitions in the
template.
2) Using Wimp_TextOp 2 to plot the text and let it worry about the font in
use. Wimp_TextOp 1 lets you work out the width of a string in the current
font.
In the case of MimeMan, 2) might be better, though 1 can have advantages
in terms of setting formatting and so on in the Templates file.
--
Steve Fryatt - Leeds, England
http://www.stevefryatt.org.uk/
.
- Follow-Ups:
- Re: Desklib + System Font = Bug?
- From: Adam
- Re: Desklib + System Font = Bug?
- References:
- Desklib + System Font = Bug?
- From: Adam
- Desklib + System Font = Bug?
- Prev by Date: Desklib + System Font = Bug?
- Next by Date: Re: Desklib + System Font = Bug?
- Previous by thread: Desklib + System Font = Bug?
- Next by thread: Re: Desklib + System Font = Bug?
- Index(es):
Relevant Pages
|