home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.2 / Bullet / libraries / diskfont.h next >
Encoding:
C/C++ Source or Header  |  1992-09-01  |  3.3 KB  |  112 lines

  1. #ifndef    LIBRARIES_DISKFONT_H
  2. #define    LIBRARIES_DISKFONT_H
  3. /*
  4. **    File: diskfont.h
  5. **
  6. **    diskfont library definitions 
  7. **
  8. **    (C) Copyright 1990 Robert R. Burns
  9. **        All Rights Reserved
  10. **    (C) Copyright 1985,1986,1987,1988,1989 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef     EXEC_NODES_H
  15. #include "exec/nodes.h"
  16. #endif
  17. #ifndef     EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif
  20. #ifndef     GRAPHICS_TEXT_H
  21. #include "graphics/text.h"
  22. #endif
  23.  
  24. #define     MAXFONTPATH 256   /* including null terminator */
  25.  
  26. struct FontContents {
  27.     char    fc_FileName[MAXFONTPATH];
  28.     UWORD   fc_YSize;
  29.     UBYTE   fc_Style;
  30.     UBYTE   fc_Flags;
  31. };
  32.  
  33. struct TFontContents {
  34.     char    tfc_FileName[MAXFONTPATH-2];
  35.     UWORD   tfc_TagCount;    /* including the TAG_DONE tag */
  36.     /*
  37.      *    if tfc_TagCount is non-zero, tfc_FileName is overlayed with
  38.      *    Text Tags starting at:  (struct TagItem *)
  39.      *        &tfc_FileName[MAXFONTPATH-(tfc_TagCount*sizeof(struct TagItem))]
  40.      */
  41.     UWORD   tfc_YSize;
  42.     UBYTE   tfc_Style;
  43.     UBYTE   tfc_Flags;
  44. };
  45.  
  46.  
  47. #define  FCH_ID        0x0f00    /* FontContentsHeader, then FontContents */
  48. #define  TFCH_ID    0x0f02    /* FontContentsHeader, then TFontContents */
  49. #define  OFCH_ID    0x0f03    /* FontContentsHeader, then TFontContents,
  50.                  * associated with outline font */
  51.  
  52. struct FontContentsHeader {
  53.     UWORD   fch_FileID;        /* FCH_ID */
  54.     UWORD   fch_NumEntries;    /* the number of FontContents elements */
  55.     /* struct FontContents fch_FC[], or struct TFontContents fch_TFC[]; */
  56. };
  57.  
  58.  
  59. #define  DFH_ID        0x0f80
  60. #define  MAXFONTNAME    32    /* font name including ".font\0" */
  61.  
  62. struct DiskFontHeader {
  63.     /* the following 8 bytes are not actually considered a part of the    */
  64.     /* DiskFontHeader, but immediately preceed it. The NextSegment is    */
  65.     /* supplied by the linker/loader, and the ReturnCode is the code    */
  66.     /* at the beginning of the font in case someone runs it...        */
  67.     /*   ULONG dfh_NextSegment;            \* actually a BPTR    */
  68.     /*   ULONG dfh_ReturnCode;            \* MOVEQ #0,D0 : RTS    */
  69.     /* here then is the official start of the DiskFontHeader...        */
  70.     struct Node dfh_DF;        /* node to link disk fonts */
  71.     UWORD   dfh_FileID;        /* DFH_ID */
  72.     UWORD   dfh_Revision;    /* the font revision */
  73.     LONG    dfh_Segment;    /* the segment address when loaded */
  74.     char    dfh_Name[MAXFONTNAME]; /* the font name (null terminated) */
  75.     struct TextFont dfh_TF;    /* loaded TextFont structure */
  76. };
  77.  
  78. /* unfortunately, this needs to be explicitly typed */
  79. /* used only if dfh_TF.tf_Style FSB_TAGGED bit is set */
  80. #define    dfh_TagList    dfh_Segment    /* destroyed during loading */
  81.  
  82.  
  83. #define     AFB_MEMORY    0
  84. #define     AFF_MEMORY    0x0001
  85. #define     AFB_DISK    1
  86. #define     AFF_DISK    0x0002
  87. #define     AFB_SCALED    2
  88. #define     AFF_SCALED    0x0004
  89. #define     AFB_BITMAP    3
  90. #define     AFF_BITMAP    0x0008
  91.  
  92. #define     AFB_TAGGED    16    /* return TAvailFonts */
  93. #define     AFF_TAGGED    0x10000L
  94.  
  95. struct AvailFonts {
  96.     UWORD   af_Type;        /* MEMORY, DISK, or SCALED */
  97.     struct TextAttr af_Attr;    /* text attributes for font */
  98. };
  99.  
  100. struct TAvailFonts {
  101.     UWORD   taf_Type;        /* MEMORY, DISK, or SCALED */
  102.     struct TTextAttr taf_Attr;    /* text attributes for font */
  103. };
  104.  
  105. struct AvailFontsHeader {
  106.     UWORD   afh_NumEntries;      /* number of AvailFonts elements */
  107.     /* struct AvailFonts afh_AF[], or struct TAvailFonts afh_TAF[]; */
  108. };
  109.  
  110. #endif    /* LIBRARIES_DISKFONT_H */
  111.  
  112.