home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / graphics / text.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  7KB  |  171 lines

  1. #ifndef    GRAPHICS_TEXT_H
  2. #define    GRAPHICS_TEXT_H
  3. /*
  4. **    $VER: text.h 39.0 (21.8.91)
  5. **    Includes Release 40.15
  6. **
  7. **    graphics library text structures
  8. **
  9. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef    EXEC_PORTS_H
  14. #include    "exec/ports.h"
  15. #endif    /* EXEC_PORTS_H */
  16.  
  17. #ifndef    GRAPHICS_GFX_H
  18. #include    "graphics/gfx.h"
  19. #endif    /* GRAPHICS_GFX_H */
  20.  
  21. #ifndef    UTILITY_TAGITEM_H
  22. #include    "utility/tagitem.h"
  23. #endif    /* UTILITY_TAGITEM_H */
  24.  
  25. /*------ Font Styles ------------------------------------------------*/
  26. #define    FS_NORMAL    0    /* normal text (no style bits set) */
  27. #define    FSB_UNDERLINED    0    /* underlined (under baseline) */
  28. #define    FSF_UNDERLINED    0x01
  29. #define    FSB_BOLD    1    /* bold face text (ORed w/ shifted) */
  30. #define    FSF_BOLD    0x02
  31. #define    FSB_ITALIC    2    /* italic (slanted 1:2 right) */
  32. #define    FSF_ITALIC    0x04
  33. #define    FSB_EXTENDED    3    /* extended face (wider than normal) */
  34. #define    FSF_EXTENDED    0x08
  35.  
  36. #define    FSB_COLORFONT    6    /* this uses ColorTextFont structure */
  37. #define    FSF_COLORFONT    0x40
  38. #define    FSB_TAGGED    7    /* the TextAttr is really an TTextAttr, */
  39. #define    FSF_TAGGED    0x80
  40.  
  41. /*------ Font Flags -------------------------------------------------*/
  42. #define    FPB_ROMFONT    0    /* font is in rom */
  43. #define    FPF_ROMFONT    0x01
  44. #define    FPB_DISKFONT    1    /* font is from diskfont.library */
  45. #define    FPF_DISKFONT    0x02
  46. #define    FPB_REVPATH    2    /* designed path is reversed (e.g. left) */
  47. #define    FPF_REVPATH    0x04
  48. #define    FPB_TALLDOT    3    /* designed for hires non-interlaced */
  49. #define    FPF_TALLDOT    0x08
  50. #define    FPB_WIDEDOT    4    /* designed for lores interlaced */
  51. #define    FPF_WIDEDOT    0x10
  52. #define    FPB_PROPORTIONAL 5    /* character sizes can vary from nominal */
  53. #define    FPF_PROPORTIONAL 0x20
  54. #define    FPB_DESIGNED    6    /* size explicitly designed, not constructed */
  55.                 /* note: if you do not set this bit in your */
  56.                 /* textattr, then a font may be constructed */
  57.                 /* for you by scaling an existing rom or disk */
  58.                 /* font (under V36 and above). */
  59. #define    FPF_DESIGNED    0x40
  60.     /* bit 7 is always clear for fonts on the graphics font list */
  61. #define    FPB_REMOVED    7    /* the font has been removed */
  62. #define    FPF_REMOVED    (1<<7)
  63.  
  64. /****** TextAttr node, matches text attributes in RastPort **********/
  65. struct TextAttr {
  66.     STRPTR  ta_Name;        /* name of the font */
  67.     UWORD   ta_YSize;        /* height of the font */
  68.     UBYTE   ta_Style;        /* intrinsic font style */
  69.     UBYTE   ta_Flags;        /* font preferences and flags */
  70. };
  71.  
  72. struct TTextAttr {
  73.     STRPTR  tta_Name;        /* name of the font */
  74.     UWORD   tta_YSize;        /* height of the font */
  75.     UBYTE   tta_Style;        /* intrinsic font style */
  76.     UBYTE   tta_Flags;        /* font preferences and flags */
  77.     struct TagItem *tta_Tags;    /* extended attributes */
  78. };
  79.  
  80.  
  81. /****** Text Tags ***************************************************/
  82. #define    TA_DeviceDPI    (1|TAG_USER)    /* Tag value is Point union: */
  83.                     /* Hi word XDPI, Lo word YDPI */
  84.  
  85. #define    MAXFONTMATCHWEIGHT    32767    /* perfect match from WeighTAMatch */
  86.  
  87.  
  88. /****** TextFonts node **********************************************/
  89. struct TextFont {
  90.     struct Message tf_Message;    /* reply message for font removal */
  91.                 /* font name in LN      \    used in this */
  92.     UWORD   tf_YSize;        /* font height          |    order to best */
  93.     UBYTE   tf_Style;        /* font style          |    match a font */
  94.     UBYTE   tf_Flags;        /* preferences and flags  /    request. */
  95.     UWORD   tf_XSize;        /* nominal font width */
  96.     UWORD   tf_Baseline;    /* distance from the top of char to baseline */
  97.     UWORD   tf_BoldSmear;    /* smear to affect a bold enhancement */
  98.  
  99.     UWORD   tf_Accessors;    /* access count */
  100.  
  101.     UBYTE   tf_LoChar;        /* the first character described here */
  102.     UBYTE   tf_HiChar;        /* the last character described here */
  103.     APTR    tf_CharData;    /* the bit character data */
  104.  
  105.     UWORD   tf_Modulo;        /* the row modulo for the strike font data */
  106.     APTR    tf_CharLoc;        /* ptr to location data for the strike font */
  107.                 /*   2 words: bit offset then size */
  108.     APTR    tf_CharSpace;    /* ptr to words of proportional spacing data */
  109.     APTR    tf_CharKern;    /* ptr to words of kerning data */
  110. };
  111.  
  112. /* unfortunately, this needs to be explicitly typed */
  113. #define    tf_Extension    tf_Message.mn_ReplyPort
  114.  
  115. /*-----    tfe_Flags0 (partial definition) ----------------------------*/
  116. #define TE0B_NOREMFONT    0    /* disallow RemFont for this font */
  117. #define TE0F_NOREMFONT    0x01
  118.  
  119. struct TextFontExtension {    /* this structure is read-only */
  120.     UWORD   tfe_MatchWord;        /* a magic cookie for the extension */
  121.     UBYTE   tfe_Flags0;            /* (system private flags) */
  122.     UBYTE   tfe_Flags1;            /* (system private flags) */
  123.     struct TextFont *tfe_BackPtr;    /* validation of compilation */
  124.     struct MsgPort *tfe_OrigReplyPort;    /* original value in tf_Extension */
  125.     struct TagItem *tfe_Tags;        /* Text Tags for the font */
  126.     UWORD  *tfe_OFontPatchS;        /* (system private use) */
  127.     UWORD  *tfe_OFontPatchK;        /* (system private use) */
  128.     /* this space is reserved for future expansion */
  129. };
  130.  
  131. /******    ColorTextFont node ******************************************/
  132. /*-----    ctf_Flags --------------------------------------------------*/
  133. #define    CT_COLORMASK    0x000F    /* mask to get to following color styles */
  134. #define    CT_COLORFONT    0x0001    /* color map contains designer's colors */
  135. #define    CT_GREYFONT    0x0002    /* color map describes even-stepped */
  136.                 /* brightnesses from low to high */
  137. #define    CT_ANTIALIAS    0x0004    /* zero background thru fully saturated char */
  138.  
  139. #define    CTB_MAPCOLOR    0    /* map ctf_FgColor to the rp_FgPen if it's */
  140. #define    CTF_MAPCOLOR    0x0001    /* is a valid color within ctf_Low..ctf_High */
  141.  
  142. /*----- ColorFontColors --------------------------------------------*/
  143. struct ColorFontColors {
  144.     UWORD   cfc_Reserved;    /* *must* be zero */
  145.     UWORD   cfc_Count;        /* number of entries in cfc_ColorTable */
  146.     UWORD  *cfc_ColorTable;    /* 4 bit per component color map packed xRGB */
  147. };
  148.  
  149. /*-----    ColorTextFont ----------------------------------------------*/
  150. struct ColorTextFont {
  151.     struct TextFont ctf_TF;
  152.     UWORD   ctf_Flags;        /* extended flags */
  153.     UBYTE   ctf_Depth;        /* number of bit planes */
  154.     UBYTE   ctf_FgColor;    /* color that is remapped to FgPen */
  155.     UBYTE   ctf_Low;        /* lowest color represented here */
  156.     UBYTE   ctf_High;        /* highest color represented here */
  157.     UBYTE   ctf_PlanePick;    /* PlanePick ala Images */
  158.     UBYTE   ctf_PlaneOnOff;    /* PlaneOnOff ala Images */
  159.     struct ColorFontColors *ctf_ColorFontColors; /* colors for font */
  160.     APTR    ctf_CharData[8];    /*pointers to bit planes ala tf_CharData */
  161. };
  162.  
  163. /****** TextExtent node *********************************************/
  164. struct TextExtent {
  165.     UWORD   te_Width;        /* same as TextLength */
  166.     UWORD   te_Height;        /* same as tf_YSize */
  167.     struct Rectangle te_Extent;    /* relative to CP */
  168. };
  169.  
  170. #endif    /* GRAPHICS_TEXT_H */
  171.