home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Text_Autodocs / diskfont.doc < prev    next >
Encoding:
Text File  |  1992-09-12  |  4.7 KB  |  151 lines

  1. TABLE OF CONTENTS
  2.  
  3. diskfont.library/AvailFonts
  4. diskfont.library/DisposeFontContents
  5. diskfont.library/NewFontContents
  6. diskfont.library/OpenDiskFont
  7.  
  8.  
  9. diskfont.library/AvailFonts                     diskfont.library/AvailFonts
  10.  
  11.   NAME
  12.     AvailFonts - build an array of all fonts in memory / on disk
  13.  
  14.   SYNOPSIS
  15.     error = AvailFonts(buffer, bufBytes, types);
  16.                A0       D0         D1
  17.  
  18.   FUNCTION
  19.     AvailFonts fills a user supplied buffer with the structure,
  20.     described below, that contains information about all the
  21.     fonts available in memory and/or on disk.  Those fonts
  22.     available on disk need to be loaded into memory and opened
  23.     via OpenDiskFont, those already in memory are accessed via
  24.     OpenFont.  The TextAttr structure required by the open calls
  25.     is part of the information AvailFonts supplies.
  26.  
  27.     When AvailFonts fails, it returns the number of extra bytes
  28.     it needed to complete the command.  Add this number to your
  29.     current buffer size, allocate a new buffer, and try again.
  30.     If the second AvailFonts call fails, abort the operation.
  31.  
  32.   INPUTS
  33.     buffer - memory to be filled with struct AvailFontsHeader
  34.         followed by an array of AvailFonts elements, which
  35.         contains entries for the available fonts and their
  36.         names.
  37.     bufBytes - the number of bytes in the buffer
  38.     types - AFF_MEMORY is set to search memory for fonts to fill
  39.         the structure, AFF_DISK is set to search the disk for
  40.         fonts to fill the structure.  Both can be specified.
  41.  
  42.   RESULTS
  43.     buffer - filled with struct AvailFontsHeader followed by the
  44.         AvailFonts elements, There will be duplicate entries
  45.         for fonts found both in memory and on disk, differing
  46.         only by type.  The existance of a disk font in the
  47.         buffer indicates that it exists as an entry in a font
  48.         contents file -- the underlying font file has not been
  49.         checked for validity, thus an OpenDiskFont of it may
  50.         fail.
  51.     error - if non-zero, this indicates the number of bytes needed
  52.         for AvailFonts in addition to those supplied.  Thus
  53.         structure elements were not returned because of
  54.         insufficient bufBytes.
  55.  
  56.  
  57. diskfont.library/DisposeFontContents
  58.  
  59.    NAME
  60.     DisposeFontContents - free the result from NewFontContents
  61.  
  62.    SYNOPSIS
  63.     DisposeFontContents(fontContentsHeader)
  64.                 A1
  65.  
  66.    FUNCTION
  67.     This function frees the array of FontContents entries
  68.     returned by NewFontContents.
  69.  
  70.    INPUTS
  71.     fontContentsHeader - a struct FontContentsHeader pointer
  72.         returned by NewFontContents.
  73.  
  74.    EXCEPTIONS
  75.     This command was first made available as of version 34.
  76.  
  77.     A fontContentsHeader other than one acquired by a call
  78.     NewFontContents will crash.
  79.  
  80.    SEE ALSO
  81.     NewFontContents to get structure freed here.
  82.  
  83.  
  84. diskfont.library/NewFontContents           diskfont.library/NewFontContents
  85.  
  86.    NAME
  87.        NewFontContents - create a FontContents structs for a font
  88.  
  89.    SYNOPSIS
  90.     fontContentsHeader = NewFontContents(fontsLock,fontName)
  91.        D0                                   A0        A1
  92.  
  93.    FUNCTION
  94.     This function creates a new array of FontContents entries
  95.     that describe all the fonts associated with the fontName,
  96.     specifically, all those in the font directory whose name
  97.     is that of the font sans the ".font" suffix.
  98.  
  99.    INPUTS
  100.     fontsLock - a DOS lock on the FONTS: directory (or other
  101.         directory where the font contents file and associated
  102.         font directory resides).
  103.     fontName - the font name, with the ".font" suffix, which
  104.         is also the name of the font contents file.  
  105.  
  106.    RESULT
  107.     fontContentsHeader - a struct FontContentsHeader pointer.
  108.  
  109.    EXCEPTIONS
  110.     This command was first made available as of version 34.
  111.  
  112.     D0 is zero if the fontName is does not have a ".font" suffix,
  113.     or a DOS error occurred, or memory could not be allocated for
  114.     the fontContentsHeader.
  115.  
  116.    SEE ALSO
  117.     DisposeFontContents to free the structure acquired here.
  118.  
  119.  
  120. diskfont.library/OpenDiskFont                 diskfont.library/OpenDiskFont
  121.  
  122.    NAME
  123.        OpenDiskFont - load and get a pointer to a disk font.
  124.  
  125.    SYNOPSIS
  126.        font = OpenDiskFont(textAttr)
  127.        D0                  A0
  128.  
  129.    FUNCTION
  130.        This function finds the font with the specified textAttr on
  131.        disk, loads it into memory, and returns a pointer to the font
  132.        that can be used in subsequent SetFont and CloseFont calls.
  133.        It is important to match this call with a corresponding
  134.        CloseFont call for effective management of font memory.
  135.  
  136.        If the font is already in memory, the copy in memory is used.
  137.        The disk copy is not reloaded.
  138.  
  139.    INPUTS
  140.        textAttr - a TextAttr structure that describes the text font
  141.                attributes desired.
  142.  
  143.    RESULTS
  144.        D0 is zero if the desired font cannot be found.
  145.  
  146.    BUGS
  147.        This routine will not work well with font names whose file
  148.     name components are longer than the maximum allowed
  149.     (30 characters).
  150.  
  151.