1 #ifndef GRAPHICS_TEXT_H 2 #define GRAPHICS_TEXT_H 3 4 /* 5 graphics text definitions 6 7 Copyright © 2002 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_PORTS_H 11 # include <exec/ports.h> 12 #endif 13 14 #ifndef GRAPHICS_GFX_H 15 # include <graphics/gfx.h> 16 #endif 17 18 #ifndef UTILITY_TAGITEM_H 19 # include <utility/tagitem.h> 20 #endif 21 22 #pragma pack(2) 23 24 25 #define FS_NORMAL 0 26 #define FSB_UNDERLINED 0 27 #define FSF_UNDERLINED (1<<FSB_UNDERLINED) 28 #define FSB_BOLD 1 29 #define FSF_BOLD (1<<FSB_BOLD) 30 #define FSB_ITALIC 2 31 #define FSF_ITALIC (1<<FSB_ITALIC) 32 #define FSB_EXTENDED 3 33 #define FSF_EXTENDED (1<<FSB_EXTENDED) 34 #define FSB_COLORFONT 6 35 #define FSF_COLORFONT (1<<FSB_COLORFONT) 36 #define FSB_TAGGED 7 37 #define FSF_TAGGED (1<<FSB_TAGGED) 38 39 40 #define FPB_ROMFONT 0 41 #define FPF_ROMFONT (1<<FPB_ROMFONT) 42 #define FPB_DISKFONT 1 43 #define FPF_DISKFONT (1<<FPB_DISKFONT) 44 #define FPB_REVPATH 2 45 #define FPF_REVPATH (1<<FPB_REVPATH) 46 #define FPB_TALLDOT 3 47 #define FPF_TALLDOT (1<<FPB_TALLDOT) 48 #define FPB_WIDEDOT 4 49 #define FPF_WIDEDOT (1<<FPB_WIDEDOT) 50 #define FPB_PROPORTIONAL 5 51 #define FPF_PROPORTIONAL (1<<FPB_PROPORTIONAL) 52 #define FPB_DESIGNED 6 53 #define FPF_DESIGNED (1<<FPB_DESIGNED) 54 #define FPB_REMOVED 7 55 #define FPF_REMOVED (1<<FPB_REMOVED) 56 57 58 struct TextAttr 59 { 60 STRPTR ta_Name; 61 UWORD ta_YSize; 62 UBYTE ta_Style; 63 UBYTE ta_Flags; 64 }; 65 66 struct TTextAttr 67 { 68 STRPTR tta_Name; 69 UWORD tta_YSize; 70 UBYTE tta_Style; 71 UBYTE tta_Flags; 72 struct TagItem *tta_Tags; 73 }; 74 75 76 #define TA_DeviceDPI (TAG_USER+1) 77 78 /* these tags override struct TextAttr fields */ 79 #define TA_Name (TAG_USER+100) 80 #define TA_YSize (TAG_USER+101) 81 82 #define TA_Underlined (TAG_USER+102) 83 #define TA_Bold (TAG_USER+103) 84 #define TA_Italic (TAG_USER+104) 85 #define TA_Extended (TAG_USER+105) 86 #define TA_ColorFont (TAG_USER+106) 87 88 #define TA_ROMFont (TAG_USER+107) 89 #define TA_DiskFont (TAG_USER+108) 90 #define TA_RevPath (TAG_USER+109) 91 #define TA_TallDot (TAG_USER+110) 92 #define TA_WideDot (TAG_USER+111) 93 #define TA_Proportional (TAG_USER+112) 94 #define TA_Designed (TAG_USER+113) 95 96 97 #define MAXFONTMATCHWEIGHT 32767 98 99 100 struct TextFont 101 { 102 struct Message tf_Message; 103 UWORD tf_YSize; 104 UBYTE tf_Style; 105 UBYTE tf_Flags; 106 UWORD tf_XSize; 107 UWORD tf_Baseline; 108 UWORD tf_BoldSmear; 109 110 UWORD tf_Accessors; 111 112 UBYTE tf_LoChar; 113 UBYTE tf_HiChar; 114 APTR tf_CharData; 115 116 UWORD tf_Modulo; 117 APTR tf_CharLoc; 118 APTR tf_CharSpace; 119 APTR tf_CharKern; 120 }; 121 122 #define tf_Extension tf_Message.mn_ReplyPort 123 124 125 #define TE0B_NOREMFONT 0 126 #define TE0F_NOREMFONT (1<<TE0B_NOREMFONT) 127 128 129 struct TextFontExtension 130 { 131 UWORD tfe_MatchWord; 132 UBYTE tfe_Flags0; 133 UBYTE tfe_Flags1; 134 struct TextFont *tfe_BackPtr; 135 struct MsgPort *tfe_OrigReplyPort; 136 struct TagItem *tfe_Tags; 137 UWORD *tfe_OFontPatchS; 138 UWORD *tfe_OFontPatchK; 139 }; 140 141 142 #define CT_COLORMASK 0x000F 143 #define CT_COLORFONT 0x0001 144 #define CT_GREYFONT 0x0002 145 #define CT_ANTIALIAS 0x0004 146 147 #define CTB_MAPCOLOR 0 148 #define CTF_MAPCOLOR (1<<CTB_MAPCOLOR) 149 150 151 struct ColorFontColors 152 { 153 UWORD cfc_Reserved; 154 UWORD cfc_Count; 155 UWORD *cfc_ColorTable; 156 }; 157 158 struct ColorTextFont 159 { 160 struct TextFont ctf_TF; 161 UWORD ctf_Flags; 162 UBYTE ctf_Depth; 163 UBYTE ctf_FgColor; 164 UBYTE ctf_Low; 165 UBYTE ctf_High; 166 UBYTE ctf_PlanePick; 167 UBYTE ctf_PlaneOnOff; 168 struct ColorFontColors *ctf_ColorFontColors; 169 APTR ctf_CharData[8]; 170 }; 171 172 struct TextExtent 173 { 174 UWORD te_Width; 175 UWORD te_Height; 176 struct Rectangle te_Extent; 177 }; 178 179 180 #pragma pack() 181 182 #endif /* GRAPHICS_TEXT_H */