Re: [cc65] tgi_outtext bug

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2012-09-20 23:20:15
Hi!

On Tue, Sep 18, 2012 at 11:15:13AM +0300, Karri Kaksonen wrote:
> The textwidth code uses something called _tgi_charwidth which is
> zeroed at the time when the driver loads. I can not find any place
> in the code that would copy _tgi_fontwidth to _tgi_charwidth.

Thanks for your efforts! tgi_charwidth and _tgi_charheight are initialized in
tgi_settextstyle, which is called at the end of tgi_init.

The problem was an error in the calculation in tgi_gettextwidth which didn't
work correctly.

One question however, since I don't know if the current implementation is
absolutely correct:

The Lynx has fine scaling for bitmap fonts. Is it correct that each character
starts at a full pixel position? So if the width of one char is 20.5 pixels,
the next one starts at 21 pixel?

If so, the width calculation needs a correction. Currently it just drops the
digits after the decimal point. But it should nevertheless generate better
results than before:-)

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 20 23:20:23 2012

This archive was generated by hypermail 2.1.8 : 2012-09-20 23:20:26 CEST