home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l391 / 2.ddi / FONT.BI$ / FONT.bin
Encoding:
Text File  |  1992-08-19  |  3.4 KB  |  80 lines

  1. ' Include file for the Presentation Graphics ToolKit font routines.
  2. '
  3. ' This file should be included in any application
  4. ' using the Presentation Graphics font routines.
  5. ' It contains declarations for all of the
  6. ' user-accessible routines as well as type definitions
  7. ' for the FontInfo datatype used by most
  8. ' of the routines.  Also included are constant
  9. ' definitions for some of the parameters that must be
  10. ' specified when using the font routines.
  11. '
  12. ' Copyright (C) 1982-1992 Microsoft Corporation
  13. '
  14.  
  15. '-- Global constants:
  16. CONST cFontBlockSize = 100
  17. CONST cIBMChars = 0
  18. CONST cWindowsChars = 1
  19.  
  20. ' Type to hold information about a font:
  21. TYPE FontInfo
  22.    FontNum        AS INTEGER        ' Position of font in reg. or loaded list
  23.    Ascent         AS INTEGER        ' From baseline to top of ascender
  24.    Points         AS INTEGER
  25.    PixWidth       AS INTEGER        ' 0 if proportional, width otherwise
  26.    PixHeight      AS INTEGER        ' Height of character bitmap
  27.    Leading        AS INTEGER        ' Internal leading above body of chars
  28.    AvgWidth       AS INTEGER        ' Average pixel width of chars
  29.    MaxWidth       AS INTEGER        ' Maximum pixel width of character
  30.    FileName       AS STRING * 66    ' .FON File name
  31.    FaceName       AS STRING * 32    ' Type face name
  32. END TYPE
  33.  
  34. ' Data type for blocks in the font data array:
  35. TYPE FontDataBlock
  36.    Block    AS STRING * cFontBlockSize   ' Buffer block for font data
  37. END TYPE
  38.  
  39. '-- Declarations for FontLib functions and subroutines:
  40.  
  41. DECLARE SUB SetMaxFonts (Registered AS INTEGER, Loaded AS INTEGER)
  42. DECLARE SUB GetMaxFonts (Registered AS INTEGER, Loaded AS INTEGER)
  43. DECLARE SUB GetTotalFonts (Registered AS INTEGER, Loaded AS INTEGER)
  44.  
  45. DECLARE FUNCTION RegisterFonts% (FileName$)
  46. DECLARE FUNCTION RegisterMemFont% (FontSeg AS INTEGER, FontOffset AS INTEGER)
  47. DECLARE SUB UnRegisterFonts ()
  48.  
  49. DECLARE FUNCTION LoadFont% (FontSpec$)
  50. DECLARE SUB SelectFont (FontNumber AS INTEGER)
  51.  
  52. DECLARE SUB GTextWindow (X1 AS SINGLE, Y1 AS SINGLE, X2 AS SINGLE, Y2 AS SINGLE, Scrn AS INTEGER)
  53. DECLARE SUB SetGCharset (CharSet AS INTEGER)
  54. DECLARE SUB SetGTextColor (C AS INTEGER)
  55. DECLARE SUB SetGTextDir (Dir AS INTEGER)
  56. DECLARE FUNCTION OutGText% (X AS SINGLE, Y AS SINGLE, Text$)
  57. DECLARE FUNCTION GetGTextLen% (Text$)
  58.  
  59. DECLARE SUB GetFontInfo (FontParams AS FontInfo)
  60. DECLARE SUB GetRFontInfo (Font AS INTEGER, FontParams AS FontInfo)
  61.  
  62. '-- Error return variable and CONST definitions:
  63.  
  64. COMMON SHARED /FontLib/ FontErr AS INTEGER
  65.  
  66. CONST cFLUnexpectedOff = 200  'Unexpected BASIC error offset
  67. CONST cFileNotFound = 1        'Specified file not found (RegisterFonts)
  68. CONST cBadFontSpec = 2         'Invalid part of a font spec (LoadFont)
  69. CONST cFontNotFound = 3        'Spec. doesn't match any font (LoadFont)
  70. CONST cBadFontFile = 5         'Invalid font file format (RegisterFonts)
  71. CONST cBadFontLimit = 6        'Invalid font limit (SetMaxFonts)
  72. CONST cTooManyFonts = 7        'Tried to go past limit (LoadFont, RegisterMemFont,
  73. '                               RegisterFonts)
  74. CONST cNoFonts = 8             'No loaded fonts (SelectFont, GetFontInfo,
  75. '                               GetGTextLen, LoadFont)
  76. CONST cBadFontType = 10        'Not bitmap font (RegisterMemFont)
  77. CONST cBadFontNumber = 11      'Bad Font Number (GetRFontInfo)
  78. CONST cNoFontMem = 12          'Not enough memory (SetMaxFonts, LoadFonts)
  79.  
  80.