]>
Commit | Line | Data |
---|---|---|
1 | diff -crN -x Makefile xc/lib/font/FreeType/ft.h xc.new/lib/font/FreeType/ft.h | |
2 | *** xc/lib/font/FreeType/ft.h Sun Apr 25 18:32:21 1999 | |
3 | --- xc.new/lib/font/FreeType/ft.h Sun Oct 10 01:48:10 1999 | |
4 | *************** | |
5 | *** 64,69 **** | |
6 | --- 64,70 ---- | |
7 | { | |
8 | int has_cmap; | |
9 | TT_CharMap cmap; | |
10 | + int base; | |
11 | struct font_encoding *encoding; | |
12 | struct font_encoding_mapping *mapping; | |
13 | }; | |
14 | *************** | |
15 | *** 78,83 **** | |
16 | --- 79,85 ---- | |
17 | ||
18 | int ttf_pick_cmap(char*, int, char*, TT_Face, struct ttf_mapping *); | |
19 | int ftstrcasecmp(const char *s1, const char *s2); | |
20 | + unsigned ttf_remap(unsigned code, struct ttf_mapping *tm); | |
21 | ||
22 | /* ftutil.c */ | |
23 | ||
24 | *************** | |
25 | *** 85,90 **** | |
26 | int ttf_u2a(int, char*, char*, int); | |
27 | int FTtoXReturnCode(int); | |
28 | int ttf_GetEnglishName(TT_Face, char *, int); | |
29 | ! | |
30 | ! | |
31 | ||
32 | --- 87,91 ---- | |
33 | int ttf_u2a(int, char*, char*, int); | |
34 | int FTtoXReturnCode(int); | |
35 | int ttf_GetEnglishName(TT_Face, char *, int); | |
36 | ! int ttf_checkForTTCName(char*, char**, int*); | |
37 | ||
38 | diff -crN -x Makefile xc/lib/font/FreeType/ftenc.c xc.new/lib/font/FreeType/ftenc.c | |
39 | *** xc/lib/font/FreeType/ftenc.c Sun Apr 25 18:32:21 1999 | |
40 | --- xc.new/lib/font/FreeType/ftenc.c Sun Oct 10 02:51:55 1999 | |
41 | *************** | |
42 | *** 23,28 **** | |
43 | --- 23,29 ---- | |
44 | */ | |
45 | ||
46 | /* TrueType-dependent encoding code */ | |
47 | + #include <string.h> | |
48 | ||
49 | #include "fontmisc.h" /* defines xalloc and friends */ | |
50 | #include "fontenc.h" | |
51 | *************** | |
52 | *** 41,46 **** | |
53 | --- 42,48 ---- | |
54 | struct font_encoding *encoding; | |
55 | struct font_encoding_mapping *mapping; | |
56 | TT_CharMap cmap; | |
57 | + | |
58 | ||
59 | char *encoding_name=0; | |
60 | ||
61 | *************** | |
62 | *** 51,56 **** | |
63 | --- 53,59 ---- | |
64 | ||
65 | if(!strcasecmp(encoding_name, "truetype-raw")) { | |
66 | tm->has_cmap=0; | |
67 | + tm->base=0; | |
68 | tm->encoding=0; | |
69 | tm->mapping=0; | |
70 | return 0; | |
71 | *************** | |
72 | *** 61,66 **** | |
73 | --- 64,79 ---- | |
74 | &cmap)) { | |
75 | tm->has_cmap=1; | |
76 | tm->cmap=cmap; | |
77 | + if(!strcasecmp(encoding_name, "microsoft-symbol")) { | |
78 | + /* deal with undocumented lossage */ | |
79 | + TT_Face_Properties properties; | |
80 | + if(!TT_Get_Face_Properties(face, &properties) && | |
81 | + properties.os2!=0) | |
82 | + tm->base=properties.os2->usFirstCharIndex-0x20; | |
83 | + else | |
84 | + tm->base=0; | |
85 | + } else | |
86 | + tm->base=0; | |
87 | tm->encoding=encoding; | |
88 | tm->mapping=mapping; | |
89 | return 0; | |
90 | *************** | |
91 | *** 82,87 **** | |
92 | --- 95,101 ---- | |
93 | if(!find_cmap(FONT_ENCODING_UNICODE, 0, 0, face, &cmap)) { | |
94 | tm->has_cmap=1; | |
95 | tm->cmap=cmap; | |
96 | + tm->base=0; | |
97 | tm->encoding=0; | |
98 | tm->mapping=0; | |
99 | return 0; | |
100 | *************** | |
101 | *** 91,96 **** | |
102 | --- 105,111 ---- | |
103 | if(!TT_Get_CharMap(face, 0, &cmap)) { | |
104 | tm->has_cmap=1; | |
105 | tm->cmap=cmap; | |
106 | + tm->base=0; | |
107 | tm->encoding=0; | |
108 | tm->mapping=0; | |
109 | return 0; | |
110 | *************** | |
111 | *** 98,103 **** | |
112 | --- 113,119 ---- | |
113 | ||
114 | /* Tough. */ | |
115 | tm->has_cmap=0; | |
116 | + tm->base=0; | |
117 | tm->encoding=0; | |
118 | tm->mapping=0; | |
119 | return 0; | |
120 | *************** | |
121 | *** 170,175 **** | |
122 | --- 186,192 ---- | |
123 | else | |
124 | return 0; | |
125 | } | |
126 | + index += tm->base; | |
127 | if(tm->has_cmap) | |
128 | return TT_Char_Index(tm->cmap, index); | |
129 | else | |
130 | diff -crN -x Makefile xc/lib/font/FreeType/ftfuncs.c xc.new/lib/font/FreeType/ftfuncs.c | |
131 | *** xc/lib/font/FreeType/ftfuncs.c Sun Jun 13 19:06:17 1999 | |
132 | --- xc.new/lib/font/FreeType/ftfuncs.c Sun Oct 10 01:49:04 1999 | |
133 | *************** | |
134 | *** 23,28 **** | |
135 | --- 23,30 ---- | |
136 | ||
137 | /* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.11 1999/06/13 13:47:29 dawes Exp $ */ | |
138 | ||
139 | + #include <string.h> | |
140 | + | |
141 | #include "fontmisc.h" | |
142 | #include "fntfilst.h" | |
143 | #include "fontutil.h" | |
144 | *************** | |
145 | *** 134,140 **** | |
146 | ||
147 | face->instances=0; | |
148 | ||
149 | ! if(ttc_checkForTTCName(fileName, &realFileName, &faceNumber)) { | |
150 | ftrc=TT_Open_Collection(ftypeEngine, realFileName, faceNumber, | |
151 | &face->face); | |
152 | } else { | |
153 | --- 136,142 ---- | |
154 | ||
155 | face->instances=0; | |
156 | ||
157 | ! if(ttf_checkForTTCName(fileName, &realFileName, &faceNumber)) { | |
158 | ftrc=TT_Open_Collection(ftypeEngine, realFileName, faceNumber, | |
159 | &face->face); | |
160 | } else { | |
161 | *************** | |
162 | *** 775,781 **** | |
163 | static void | |
164 | FreeTypeFreeXFont(FontPtr pFont, int freeProps) | |
165 | { | |
166 | - int i; | |
167 | TTFFont *tf; | |
168 | ||
169 | if(pFont) { | |
170 | --- 777,782 ---- | |
171 | *************** | |
172 | *** 812,818 **** | |
173 | int rawAverageWidth) | |
174 | { | |
175 | int i, j, maxprops; | |
176 | - unsigned long code; | |
177 | char *sp, *ep, val[256]; | |
178 | TT_Instance_Metrics imetrics; | |
179 | int upm; /* units per em */ | |
180 | --- 813,818 ---- | |
181 | *************** | |
182 | *** 1573,1579 **** | |
183 | FontEncoding charEncoding, unsigned long *glyphCount, | |
184 | CharInfoPtr *glyphs, int nlevels) | |
185 | { | |
186 | - int idx; | |
187 | unsigned code; | |
188 | TTFFont *tf; | |
189 | CharInfoPtr *gp; | |
190 | --- 1573,1578 ---- | |
191 | diff -crN -x Makefile xc/lib/font/FreeType/ftfuncs.h xc.new/lib/font/FreeType/ftfuncs.h | |
192 | *** xc/lib/font/FreeType/ftfuncs.h Sun Apr 25 18:32:22 1999 | |
193 | --- xc.new/lib/font/FreeType/ftfuncs.h Sun Oct 10 01:45:15 1999 | |
194 | *************** | |
195 | *** 6,14 **** | |
196 | /* Glyphs are held in segments of this size */ | |
197 | #define FONTSEGMENTSIZE 16 | |
198 | ||
199 | - /* defined in atom.c */ | |
200 | - Atom MakeAtom(char *, unsigned, int); | |
201 | - | |
202 | /* A structure that holds bitmap order and padding info. */ | |
203 | ||
204 | typedef struct { | |
205 | --- 6,11 ---- | |
206 | diff -crN -x Makefile xc/lib/font/FreeType/ftutil.c xc.new/lib/font/FreeType/ftutil.c | |
207 | *** xc/lib/font/FreeType/ftutil.c Sun Apr 25 18:32:22 1999 | |
208 | --- xc.new/lib/font/FreeType/ftutil.c Sun Oct 10 01:50:22 1999 | |
209 | *************** | |
210 | *** 161,167 **** | |
211 | int | |
212 | ttf_GetEnglishName(TT_Face face, char *name, int nameID) | |
213 | { | |
214 | ! int i, j, nrec; | |
215 | unsigned short slen; | |
216 | unsigned short nrPlatformID, nrEncodingID, nrLanguageID, nrNameID; | |
217 | char *s; | |
218 | --- 161,167 ---- | |
219 | int | |
220 | ttf_GetEnglishName(TT_Face face, char *name, int nameID) | |
221 | { | |
222 | ! int i, nrec; | |
223 | unsigned short slen; | |
224 | unsigned short nrPlatformID, nrEncodingID, nrLanguageID, nrNameID; | |
225 | char *s; | |
226 | *************** | |
227 | *** 179,185 **** | |
228 | nrLanguageID==0x0c09 || nrLanguageID==0x1009 || | |
229 | nrLanguageID==0x1409 || nrLanguageID==0x1809)) || | |
230 | /* or for Apple, Unicode, English */ | |
231 | ! ((nrPlatformID==0 && nrNameID==nameID & | |
232 | nrLanguageID==0))) { | |
233 | if(!TT_Get_Name_String(face, i, &s, &slen)) | |
234 | return ttf_u2a(slen, s, name, MSBFirst); | |
235 | --- 179,185 ---- | |
236 | nrLanguageID==0x0c09 || nrLanguageID==0x1009 || | |
237 | nrLanguageID==0x1409 || nrLanguageID==0x1809)) || | |
238 | /* or for Apple, Unicode, English */ | |
239 | ! ((nrPlatformID==0 && nrNameID==nameID && | |
240 | nrLanguageID==0))) { | |
241 | if(!TT_Get_Name_String(face, i, &s, &slen)) | |
242 | return ttf_u2a(slen, s, name, MSBFirst); | |
243 | *************** | |
244 | *** 206,212 **** | |
245 | } | |
246 | ||
247 | int | |
248 | ! ttc_checkForTTCName(char *fileName, char **realFileName, int *faceNumber) | |
249 | { | |
250 | int length; | |
251 | int fn; | |
252 | --- 206,212 ---- | |
253 | } | |
254 | ||
255 | int | |
256 | ! ttf_checkForTTCName(char *fileName, char **realFileName, int *faceNumber) | |
257 | { | |
258 | int length; | |
259 | int fn; | |
260 | diff -crN -x Makefile xc/lib/font/fontfile/fontenc.c xc.new/lib/font/fontfile/fontenc.c | |
261 | *** xc/lib/font/fontfile/fontenc.c Sun Oct 10 03:03:10 1999 | |
262 | --- xc.new/lib/font/fontfile/fontenc.c Sun Oct 10 02:24:00 1999 | |
263 | *************** | |
264 | *** 518,537 **** | |
265 | {0,0,0,0,0,0,0} | |
266 | }; | |
267 | ||
268 | ! /* Apparently, Microsoft Symbol aims at being compatible with Unicode | |
269 | ! * by using the 16 columns of the Private Use Area starting at code | |
270 | ! * 0xF000. */ | |
271 | ! | |
272 | ! static unsigned | |
273 | ! eight_bit_to_microsoft_symbol(unsigned code, void *client_data) | |
274 | ! { | |
275 | ! return code+0xF000; | |
276 | ! } | |
277 | ||
278 | static struct font_encoding_mapping microsoft_symbol[]= | |
279 | ! {{FONT_ENCODING_TRUETYPE,3,0,eight_bit_to_microsoft_symbol,0,0,0}, | |
280 | /* You never know */ | |
281 | ! {FONT_ENCODING_TRUETYPE,3,1,eight_bit_to_microsoft_symbol,0,0,0}, | |
282 | {0,0,0,0,0,0,0}}; | |
283 | ||
284 | static struct font_encoding_mapping apple_roman[]= | |
285 | --- 518,531 ---- | |
286 | {0,0,0,0,0,0,0} | |
287 | }; | |
288 | ||
289 | ! /* Microsoft Symbol is treated specially in ftenc.c, where we add | |
290 | ! * usFirstCharIndex-0x20 to the glyph index before applying the | |
291 | ! * cmap. */ | |
292 | ||
293 | static struct font_encoding_mapping microsoft_symbol[]= | |
294 | ! {{FONT_ENCODING_TRUETYPE,3,0,0,0,0,0}, | |
295 | /* You never know */ | |
296 | ! {FONT_ENCODING_TRUETYPE,3,1,0,0,0,0}, | |
297 | {0,0,0,0,0,0,0}}; | |
298 | ||
299 | static struct font_encoding_mapping apple_roman[]= |