Re: [cc65] tgi text output specification

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-10-28 12:52:29
On Wed, Oct 28, 2009 at 04:24:36AM -0700, Fatih Aygün wrote:
> magx and magy are supposed to be horizontal and vertical magnification. So 2,3
> means each pixel in the font will be drawn as a 2x3 pixel box. Right?

Yes.

>
> dir is the direction. horizontal or vertical. And vertical doesn't mean rotated but it
> means something like this:
> A
> T
> A
> R
> I
> Right?

No. It means rotated by 90° ccw. This may be used to label the Y axis of a
diagram.

> The driver implements clipping it self. Right?

Currently the tgi wrapper passes outtext to the driver without clipping. But I
think it's another case, where clipping may be moved to the wrapper, otherwise
every single driver has to implement it. Problem with this approach is that
the wrapper will clip on a character boundary, so characters that don't fit
fully on the screen will get dropped completely. If this is not acceptable, we
will leave it as it is (driver does clipping).

> The text will be drawn with the current drawing color. What about the background color?
> Should it be transparent or use color 0? If the second is true, it would be nice to be able
> to adjust the background color. I personally think that transparency would open up more
> possibilities. It's easy to implement in the case of text drawing, at least for Atari.

It is not drawn. Assume a ROM font where every pixel that represents the
character is a "1", every background pixel is a "0". OUTTEXT will only draw
the pixels that correspond to a "1" and leave the others alone.

If you want the background cleared, you can draw a bar in the background color
before outputing the text.

BTW, here is a little teaser:

    http://www.cc65.org/vectorfont/goth-1x1.png
    http://www.cc65.org/vectorfont/goth-1x2.png
    http://www.cc65.org/vectorfont/goth-2x1.png
    http://www.cc65.org/vectorfont/goth-2x2.png
    http://www.cc65.org/vectorfont/litt-1x1.png
    http://www.cc65.org/vectorfont/litt-2x2.png
    http://www.cc65.org/vectorfont/litt-2x4.png
    http://www.cc65.org/vectorfont/litt-3x3.png
    http://www.cc65.org/vectorfont/litt-3x5.png
    http://www.cc65.org/vectorfont/litt-4x2.png
    http://www.cc65.org/vectorfont/litt-4x4.png
    http://www.cc65.org/vectorfont/trip-1x1.png
    http://www.cc65.org/vectorfont/trip-1x2.png
    http://www.cc65.org/vectorfont/trip-2x1.png
    http://www.cc65.org/vectorfont/trip-2x2.png
      
I've managed to read and output the vector fonts that Borland used in their
BGI interface. There are 7 different fonts available (as far as I remember),
others can be created using a font editor. The fonts are scalable (because
it's a vector format) and can easily be rotated. The original file format is
not very friendly because it needs seeking, but writing a converter wouldn't
be a big problem.

Above screenshots show a C program that loads the fonts into memory and plots
text using these fonts. All this can be done platform independently by a C
routine, so every platform that has a TGI driver with line drawing capability
can use these fonts.

A problem is the copyright, however. But since Borland (or whatever is todays
name of the company) offers the old Turbo C and Turbo Pascal packages as free
download, and these packages include above vector fonts, this shouldn't be an
unsolvable problem. As mentioned above, simpler fonts could also be created.

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 Wed Oct 28 13:03:47 2009

This archive was generated by hypermail 2.1.8 : 2009-10-28 13:03:49 CET