[comp.sys.ibm.pc] Borland Graphics Interface

mring@daimi.dk (Michael Ringgaard) (01/10/89)

I am looking for a description of Borlands Graphics Interface file
formats. In Turbo Pascal V5.0 the Graph Unit contains procedures to
install your own BGI files and fonts, but the Turbo Pascal manual does
not specify the format of these files. I want to make my own graphic
drivers so I need information about the interface between the Graph
Unit and the BGI graphic device drivers. I also would like to make my
own fonts but I do not have the file format of the font files (pixel
fonts and stroked fonts). If anyone could please supply me with this
information at my e-mail address, I would greatly appreciate it.


                                          Michael Ringgaard
                                          DAIMI, Aarhus University
                                          Denmark

teittinen@cc.helsinki.fi (01/11/89)

I would like have the information of the font file format, too. 
E-mail, please.

-----------------------------------+-------------------------------------------
    EARN: teittinen@finuh          I "Studying is the only way to do nothing
Internet: teittinen@cc.helsinki.fi I  without anyone complaining about it."
-----------------------------------+-------------------------------------------
             Marko Teittinen, student of computer science
-------------------------------------------------------------------------------

dmurdoch@watdcsu.waterloo.edu (D.J. Murdoch - Statistics) (01/12/89)

In article <1892@daimi.dk> mring@mimas.UUCP (Michael Ringgaard) writes:
>
>I am looking for a description of Borlands Graphics Interface file
>formats. In Turbo Pascal V5.0 the Graph Unit contains procedures to
>install your own BGI files and fonts, but the Turbo Pascal manual does
>not specify the format of these files. I want to make my own graphic

In Borland's support area on Compuserve, this question has come up 
repeatedly since V4.0 was released.  The answer used to be that the
formats would be released very soon;  now they just say that they'll
be released sometime.  I'd guess that this means they haven't settled
on what they should look like, and we'll have to wait for V6.0 (or 
later) for them to be willing to commit themselves.

Duncan Murdoch

morris@dms.UUCP (Jim Morris) (01/13/89)

From article <1892@daimi.dk>, by mring@daimi.dk (Michael Ringgaard):
> 
> 
> I am looking for a description of Borlands Graphics Interface file
> formats. In Turbo Pascal V5.0 the Graph Unit contains procedures to
> ........
>                                           Michael Ringgaard
>                                           DAIMI, Aarhus University
>                                           Denmark

So are a great number of people!

I just talked to Borland Support and they say it has not been released yet,
and could not tell me when it would be released.

Personally I would like to use the 640x480x256 mode on my VGA, but short
of writing a complete Turbo-Clone graphics library I can't do it.

Anyone have any ideas, more info or a turbo-clone graphics library???

	Let us know.
-- 
Jim Morris.         			 morris@dms.UUCP or weitek!dms!morris
           Atari Games Corporation, Sycamore Drive, Milpitas CA 95035.
       (Arcade Video Game Manufacturer, NOT Atari Corp. ST manufacturer).
 Any opinions expressed are probably my own, and not those of Atari Games Corp.

jerry@starfish.Convergent.COM (Gerald Hawkins) (01/14/89)

From article <596@dms.UUCP>, by morris@dms.UUCP (Jim Morris):
> 
> Personally I would like to use the 640x480x256 mode on my VGA, but short
> of writing a complete Turbo-Clone graphics library I can't do it.
> Anyone have any ideas, more info or a turbo-clone graphics library???
> -- 
> Jim Morris.         			 morris@dms.UUCP or weitek!dms!morris
-
-
I second the motion.  The Borland graphics routines are based around the
EGA.  I was suprised that the extensive library of graphics included with
Turbo C 2.0 did not include significant support for VGA.  VGA has been
the "standard" (if there is one) for 1.5 years now; Borland should let us
use it fully.  I want a nice way to use my 256K colors on the screen at
once.  (Unfortunately my eye can only discern a few hundred, but heck, I
want 'em all).

I also want an integrated environment editor that gracefully allows the
use of 43 or more lines, 120 or 132 columns.  VGA is here, Borland!


Rainy Days and
Automatic Weapons Fire
Alway Get Me Down.

These opinions are mine.
Jerry.  (jerry@starfish.convergent.COM)
-----

noren@dinl.uucp (Charles Noren) (01/14/89)

In article <1285@cc.helsinki.fi> teittinen@cc.helsinki.fi writes:
>
>I would like have the information of the font file format, too. 
>E-mail, please.

I would like the information also, how about post a summary?
-- 
Chuck Noren
NET:     ncar!dinl!noren
US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260,
         Denver, CO 80201-1260
Phone:   (303) 971-7930

dmurdoch@watdcsu.waterloo.edu (D.J. Murdoch - Statistics) (01/15/89)

I got the following from Compuserve's Borland forum.  I haven't tested 
it at all, but it should be a start.  It was called BGIFMT.TXT. I didn't
write it and can't answer any questions about it.

---------  cut here  -----------

The following is what I have been able to decipher about the format of
BGI font files.  This is NOT from Borland International.  Hope this helps
someone start on a font designer program while we wait for BI to officially
announce the format.

FontSig          : array[1..4] of byte;    { PK#8#8 }
FontDesc         : array[1..199] of char;  { null terminated string       }
                                           { length can vary              }
EndOfDesc        : char;                   { #26                          }
OffSetToFontData : word;                   { location of font information }
                                           { from beginning of file       }
FontName         : array[1..4] of char;
SizeOfFontInfo   : word;
UnKnown1         : byte;                   { Always 43?????               }
NumberOfChars    : word;
UnKnown2         : byte;
FirstASCIIChar   : byte;
OffsetToCommands : word;                   { Add 2 offsets together to get  }
                                           { location from beginning of file}
UnKnown3         : byte;
MaxXSize         : shortint;
UnKnown4         : byte;
MinYSize         : shortint;
UnKnown5         : array[1..5] of byte;
OffSetTable      : array[1..# chars] of word;  { contains offset to commands }
                                               { for drawing characters      }
WidthTable       : array[1..# chars] of byte;

The rest of the file contains a variable length list of 2 byte commands
followed by 2 null characters.  This is where the offset table helps you to
locate the particular commands for each character.
The 2 byte commands have the following format:

Byte 1  ---------------------------------
        | 1 |   |   |   |   |   |   |   |
        ---------------------------------
          ^   ^   ^   ^   ^   ^   ^   ^
          |   |   |   |   |   |   |   |
          |   ---------------------------- X offset of command
          |------ always 1????

Byte 2  ---------------------------------     2nd byte of command
        |   |   |   |   |   |   |   |   |
        ---------------------------------
          ^   ^   ^   ^   ^   ^   ^   ^
          |   |   |   |   |   |   |   |
          |   ---------------------------- Y offset of command
          |------ 0 = MoveTo command
                  1 = LineTo command

The following is an example of the commands to draw the "!" character
in the litt.chr font.

128 0 128 128 128 2 128 135 131 0 0 0

This would be translated to:
  MoveTo(x+0,y+0);
  LineTo(x+0,y+0);
  MoveTo(x+0,y+2);
  LineTo(x+0,y+7);
  MoveTo(x+3,y+0);
------------------  end of BGIFMT.TXT  ---------------------

lyourk@ihlpf.ATT.COM (Loran N. Yourk) (01/15/89)

From article <915@starfish.Convergent.COM>, by jerry@starfish.Convergent.COM (Gerald Hawkins):

] Borland BGI stuff......

] 
] I also want an integrated environment editor that gracefully allows the
] use of 43 or more lines, 120 or 132 columns.  VGA is here, Borland!
] 
] These opinions are mine.
] Jerry.  (jerry@starfish.convergent.COM)

The integrated environment editor of Turbo C 2.0 and
Pascal Version 5 both support 43/50 line modes if
your display can accommodate them.  Go to the
Options/Environment/Screen_size menu and change the screen size.

Loran Yourk (att!ihlpf!lyourk)