home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / nduk-v37.lha / V37 / include / graphics / text.h < prev    next >
C/C++ Source or Header  |  1991-11-27  |  7KB  |  173 lines

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