Re: [cc65] TGI bitmap font problem

From: Greg King <greg.king41verizon.net>
Date: 2011-07-18 10:17:32
From: "Ullrich von Bassewitz"; on Sun, July 17, 2011; at 09:29 AM -0400
>
> There's a problem with scaled bitmap fonts when using an 8.8
> fixed-point scaling factor: Where does the next character begin?

A better way of asking the question is:  Where does the current
character end (the next character must begin at the next pixel, of
course)?

>
> Assume a text string starting at 100,100 with a scaling factor
> of $0180 (= 1.5). If the width of the font is 9, the character would
> be scaled using 1.5, which gives a width of 9 * 1.5 = 13.5.
> Does the next character begin at 113.5, 113, or 114?

We cannot plot a half-pixel!  Therefore, the real question is:
Do we plot that character as 13 or 14 pixels wide.

>
> What if we have a scale factor of $140 (= 1.25). In the example above,
> the width would be 9 * 1.25 = 11.25.
>
> Assuming we start the next char. at the next full pixel, string-width
> calculation becomes really complex, because it is not just
> width*length, but for each character, the width must be added and
> rounding must be done.

Again, I say that the real question is, do we truncate, round, or
augment the fractional part of the character-width, _not_ the next
position?  (It must be done in the same way that the font actually is
drawn on the screen.)

P.S., I wonder how the Lynx's hardware graphics engine answers those
questions.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Jul 18 11:28:13 2011

This archive was generated by hypermail 2.1.8 : 2011-07-18 11:28:17 CEST