-
Notifications
You must be signed in to change notification settings - Fork 0
/
font.h
117 lines (102 loc) · 3.59 KB
/
font.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* Copyright ©1996-2009 pinc Software. All Rights Reserved.
* Licensed under the terms of the GNU General Public License, version 3.
*/
#ifndef IGN_FONT_H
#define IGN_FONT_H
struct FontFamily {
struct Node ff_Node;
};
struct Font {
struct Node fo_Node;
#ifdef __amigaos4__
struct EGlyphEngine *fo_Engine;
#else
struct GlyphEngine *fo_Engine;
#endif
long fo_Style;
long fo_Space;
struct TagItem *fo_Tags;
};
struct FontInfo {
struct MinNode fi_Node;
struct FontSize *fi_FontSize;
struct Node *fi_Family;
LONG fi_CharSpace;
long fi_Style;
UBYTE fi_Kerning;
long fi_Locked;
};
#define FS_PLAIN 0 /* Font-Style */
#define FS_BOLD 1
#define FS_ITALIC 2
#define FS_STYLE_MASK 3
#define FS_UNDERLINED 4
#define FS_DOUBLE_UNDERLINED 8
#define FS_STRIKE_THROUGH 16
#define FS_ALLBITS 32768
#define FS_UNSET 65536
#define FS_ITALIC_ANGLE 20
#define FS_BOLD_FACTOR 0x1000
#define FK_NONE 0 /* Kerning */
#define FK_TEXT 1
#define FK_DESIGN 2
#define FA_PointHeight TAG_USER+100 /* Tags for SetFontInfo() */
#define FA_Space TAG_USER+101
#define FA_Style TAG_USER+102
#define FA_Rotate TAG_USER+103
#define FA_Kerning TAG_USER+104
#define FA_Family TAG_USER+105
#define FA_Shear TAG_USER+106
#define FA_Embolden TAG_USER+107 /* not yet implemented */
#define FA_Width TAG_USER+108 /* not yet implemented */
#define FA_FreeReference TAG_USER+120
struct FontSize {
struct FontChar *fs_CharsArray[256]; // all character codes from 0 to 256
struct MinList fs_Chars; // all codes > 256
struct Font *fs_Font;
ULONG fs_DPI;
ULONG fs_PointHeight;
ULONG fs_EMWidth;
ULONG fs_EMHeight;
WORD fs_EMTop;
WORD fs_Space;
WORD fs_Rotate;
WORD fs_Shear, fs_BasicShear;
ULONG fs_RotateSin,fs_RotateCos;
ULONG fs_ShearSin,fs_ShearCos;
ULONG fs_EmboldenX, fs_BasicEmboldenX;
APTR fs_Pool;
long fs_Locked;
};
#define FS_POOLSIZE 8192
struct FontChar {
struct MinNode fc_Node;
UWORD fc_Code;
struct GlyphMap fc_Glyph;
};
/*************************** Prototypes ***************************/
extern void SearchFonts(void);
extern void GetFonts(struct MinList *list,STRPTR dir,BOOL addfont);
extern void AddFontPath(STRPTR path);
extern void FreeFonts(void);
extern void GetFontChars(struct FontSize *,STRPTR);
extern void PUBLIC DrawTextWithWidth(REG(a0, struct RastPort *rp),REG(a1, struct FontInfo *fi),REG(a2, STRPTR t),REG(d0, long x),REG(d1, long y),REG(d2, long width));
extern void PUBLIC DrawText(REG(a0, struct RastPort *rp),REG(a1, struct FontInfo *fi),REG(a2, STRPTR t),REG(d0, long x),REG(d1, long y));
extern ULONG PUBLIC OutlineLength(REG(a0, struct FontInfo *fi),REG(a1, STRPTR text),REG(d0, long len));
extern ULONG PUBLIC OutlineHeight(REG(a0, struct FontInfo *fi),REG(a1, STRPTR text),REG(d0, long len));
extern void PUBLIC FreeFontInfo(REG(a0, struct FontInfo *fi));
extern struct FontInfo * PUBLIC NewFontInfoA(REG(a0, struct FontInfo *fi),REG(d0, ULONG dpi),REG(a1, struct TagItem *ti));
#ifdef __amigaos4__
extern struct FontInfo *NewFontInfo(struct FontInfo *fi,ULONG dpi,...) VARARGS68K;
#else
extern struct FontInfo *NewFontInfo(struct FontInfo *fi,ULONG dpi,ULONG tag,...) VARARGS68K;
#endif
extern struct FontInfo * PUBLIC SetFontInfoA(REG(a0, struct FontInfo *fi),REG(d0, ULONG dpi),REG(a1, struct TagItem *ti));
#ifdef __amigaos4__
extern struct FontInfo *SetFontInfo(struct FontInfo *fi,ULONG dpi,...) VARARGS68K;
#else
extern struct FontInfo *SetFontInfo(struct FontInfo *fi,ULONG dpi,ULONG tag,...) VARARGS68K;
#endif
extern struct FontInfo * PUBLIC CopyFontInfo(REG(a0, struct FontInfo *fi));
#endif /* IGN_FONT_H */