home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / MISC.SWG / 0003_CHR.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  2KB  |  61 lines

  1. --------F-CHR-------------------------------
  2.  
  3. The  CHR files are scalable fonts used by the Borland graphics interface
  4. (BGI) to display fonts in graphics mode.
  5.  
  6. OFFSET              Count TYPE   Description
  7.  
  8. 0000h                   4 char   ID='PK',08,08
  9. 0004h                   4 char   ID='BGI '
  10. 0008h                   ? char   Font description, terminated with #26
  11. 0008h                   1 word   Headersize
  12. +????                            ="SIZ"
  13.                         4 char   Internal font name
  14.                         1 word   Font file size in bytes
  15.                         1 byte   Font driver major version
  16.                         1 byte   Font driver minor version
  17.                         1 word   0100h
  18.                     "SIZ" word   Zeroes to pad out the header
  19. 0080h                   1 char   Signature byte, '+' means stroke font
  20. 0081h                   1 word   Number of chars in font file
  21.                                  ="NUM"
  22. 0083h                   1 byte   undefined
  23. 0084h                   1 byte   ASCII value of first char in file
  24. 0085h                   1 word   Offset to stroke definitions
  25. 0087h                   1 byte   Scan flag ??
  26. 0088h                   1 byte   Distance from origin to top of capital
  27. 0089h                   1 byte   Distance from origin to baseline
  28. 008Ah                   1 byte   Distance from origin to bottom descender
  29. 008Bh                   4 char   Four character name of font
  30. 0090h               "NUM" word   Offsets to character definitions
  31. 0090h+              "NUM" byte   Width table for the characters
  32. "NUM"*2
  33. 0090h+                           Start of character definitions
  34. "NUM"*3
  35.  
  36. The  individual  character definitions consist  of  a variable number of
  37. words  describing  the operations required  to  render a character. Each
  38. word  consists of an (x,y) coordinate pair and a two-bit opcode, encoded
  39. as shown here:
  40.  
  41. Byte 1          7   6   5   4   3   2   1   0     bit #
  42.                op1  <seven bit signed X coord>
  43.  
  44. Byte 2          7   6   5   4   3   2   1   0     bit #
  45.                op2  <seven bit signed Y coord>
  46.  
  47.           Opcodes
  48.  
  49.         op1=0  op2=0  End of character definition.
  50.         op1=0  op2=1  Do scan
  51.         op1=1  op2=0  Move the pointer to (x,y)
  52.         op1=1  op2=1  Draw from current pointer to (x,y)
  53.  
  54. EXTENSION:CHR
  55. OCCURENCES:PC
  56. PROGRAMS:Borland Pascal, Borland C
  57. REFERENCE:BGIKIT.ZIP
  58. SEE ALSO:
  59. VALIDATION:
  60.  
  61.