[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 /******************************************************************** 2 * * 3 * Title: pfm2afm - Convert Windows .pfm files to .afm files * 4 * * 5 * Author: Ken Borgendale 10/9/91 * 6 * * 7 * Function: * 8 * Declare types and constants for pfm2afm. * 9 * * 10 * Copyright: * 11 * pfm2afm - Copyright (C) IBM Corp., 1991 * 12 * * 13 * This code is released for public use as long as the * 14 * copyright remains intact. This code is provided asis * 15 * without any warrenties, express or implied. * 16 * * 17 * Note: * 18 * 1. Be very careful of the packing of the PFM structure. * 19 * This is a very badly designed data structure. (I just * 20 * read it, Microsoft designed it). * 21 * * 22 ********************************************************************/ 23 24 /******************************************************************** 25 * Modified: Russell Lang <[email protected]> * 26 * 1994-01-06 Version 1.1 * 27 * Compiles with EMX/GCC * 28 * Added ItalicAngle * 29 * Added UnderlinePosition * 30 * Added UnderlineThickness * 31 * Modified: rjl 1995-03-10 (fixes from Norman Walsh) * 32 * Added unix conditional * 33 ********************************************************************/ 34 35 36 /******************************************************************** 37 * Modified: Olivier Plathey <[email protected]> * 38 * 2002-08-10 Version 1.11 * 39 * Added WIN32 conditional * 40 ********************************************************************/ 41 /* 42 * Define unsigned types and other compiler sensitive stuff 43 */ 44 typedef unsigned char uchar; 45 typedef unsigned short ushort; 46 typedef unsigned long ulong; 47 typedef unsigned int uint; 48 #if defined(__EMX__) || defined(unix) || defined(WIN32) 49 #if defined(__EMX__) 50 #define itoa(a,b,c) _itoa(a,b,c) 51 #endif 52 #define NEAR 53 #define MAINENT int 54 #else 55 #define NEAR near 56 #define MAINENT _cdecl 57 #endif 58 #define OPTSEP '/' 59 #define PATHSEP ';' 60 61 /* 62 * Declare Windows .pfm structure. Many fields are not declared if 63 * they are not used by this program. 64 */ 65 66 /* 67 * This structure was created with no thought to alignment, so we must 68 * set the alignment to character. 69 */ 70 #pragma pack(1) 71 typedef struct pfm_ { 72 ushort vers; 73 ulong len; /* Total length of .pfm file */ 74 uchar copyright[60]; /* Copyright string */ 75 ushort type; 76 ushort points; 77 ushort verres; 78 ushort horres; 79 ushort ascent; 80 ushort intleading; 81 ushort extleading; 82 uchar italic; 83 uchar uline; 84 uchar overs; 85 ushort weight; 86 uchar charset; /* 0=windows, otherwise nomap */ 87 ushort pixwidth; /* Width for mono fonts */ 88 ushort pixheight; 89 uchar kind; /* Lower bit off in mono */ 90 ushort avgwidth; /* Mono if avg=max width */ 91 ushort maxwidth; /* Use to compute bounding box */ 92 uchar firstchar; /* First char in table */ 93 uchar lastchar; /* Last char in table */ 94 uchar defchar; 95 uchar brkchar; 96 ushort widthby; 97 ulong device; 98 ulong face; /* Face name */ 99 ulong bits; 100 ulong bitoff; 101 ushort extlen; 102 ulong psext; /* PostScript extension */ 103 ulong chartab; /* Character width tables */ 104 ulong res1; 105 ulong kernpairs; /* Kerning pairs */ 106 ulong kerntrack; /* Track Kern table */ /* rjl */ 107 ulong fontname; /* Font name */ 108 } PFM; 109 #pragma pack() 110 111 /* 112 * Some metrics from the PostScript extension 113 */ 114 typedef struct psx_ { 115 ushort len; 116 uchar res1[12]; 117 /* uchar res1[14]; replaced by above two lines by rjl */ 118 ushort capheight; /* Cap height */ 119 ushort xheight; /* X height */ 120 ushort ascender; /* Ascender */ 121 ushort descender; /* Descender (positive) */ 122 /* extra entries added by rjl */ 123 short slant; /* CW italic angle */ 124 short superscript; 125 short subscript; 126 short superscriptsize; 127 short subscriptsize; 128 short underlineoffset; /* +ve down */ 129 short underlinewidth; /* width of underline */ 130 } PSX; 131 132 /* 133 * Kerning pairs 134 */ 135 typedef struct kern_ { 136 uchar first; /* First character */ 137 uchar second; /* Second character */ 138 short kern; /* Kern distance */ 139 } KERN; 140 141 /* 142 * Translate table from 1004 to psstd. 1004 is an extension of the 143 * Windows translate table used in PM. 144 */ 145 uchar Win2PSStd[] = { 146 0, 0, 0, 0, 197, 198, 199, 0, 202, 0, 205, 206, 207, 0, 0, 0, 147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148 32, 33, 34, 35, 36, 37, 38, 169, 40, 41, 42, 43, 44, 45, 46, 47, 149 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 150 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 151 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 152 193, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 153 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 154 0, 0, 184, 0, 185, 188, 178, 179, 94, 189, 0, 172, 234, 0, 0, 0, 155 0, 96, 0, 170, 186, 0, 177, 208, 126, 0, 0, 173, 250, 0, 0, 0, 156 0, 161, 162, 163, 168, 165, 0, 167, 200, 0, 227, 171, 0, 0, 0, 0, 157 0, 0, 0, 0, 194, 0, 182, 180, 203, 0, 235, 187, 0, 0, 0, 191, 158 0, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 251, 160 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 161 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, 0, 0, 162 }; 163 164 /* 165 * Character class. This is a minor attempt to overcome the problem that 166 * in the pfm file, all unused characters are given the width of space. 167 */ 168 uchar WinClass[] = { 169 0, 0, 0, 0, 2, 2, 2, 0, 2, 0, 2, 2, 2, 0, 0, 0, /* 00 */ 170 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 */ 171 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 */ 172 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 30 */ 173 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 */ 174 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 */ 175 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 */ 176 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, /* 70 */ 177 0, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, /* 80 */ 178 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, /* 90 */ 179 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* a0 */ 180 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* b0 */ 181 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c0 */ 182 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d0 */ 183 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e0 */ 184 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* f0 */ 185 }; 186 187 /* 188 * Windows chararacter names. Give a name to the usused locations 189 * for when the all flag is specified. 190 */ 191 uchar NEAR * WinChars[] = { 192 "W00", /* 00 */ 193 "W01", /* 01 */ 194 "W02", /* 02 */ 195 "W03", /* 03 */ 196 "macron", /* 04 */ /* ?? */ 197 "breve", /* 05 */ /* ?? */ 198 "dotaccent", /* 06 */ /* ?? */ 199 "W07", /* 07 */ 200 "ring", /* 08 */ /* ?? */ 201 "W09", /* 09 */ 202 "W0a", /* 0a */ 203 "W0b", /* 0b */ 204 "W0c", /* 0c */ 205 "W0d", /* 0d */ 206 "W0e", /* 0e */ 207 "W0f", /* 0f */ 208 "hungarumlaut", /* 10 */ /* ?? */ 209 "ogonek", /* 11 */ /* ?? */ 210 "caron", /* 12 */ /* ?? */ 211 "W13", /* 13 */ 212 "W14", /* 14 */ 213 "W15", /* 15 */ 214 "W16", /* 16 */ 215 "W17", /* 17 */ 216 "W18", /* 18 */ 217 "W19", /* 19 */ 218 "W1a", /* 1a */ 219 "W1b", /* 1b */ 220 "W1c", /* 1c */ 221 "W1d", /* 1d */ 222 "W1e", /* 1e */ 223 "W1f", /* 1f */ 224 "space", /* 20 */ 225 "exclam", /* 21 */ 226 "quotedbl", /* 22 */ 227 "numbersign", /* 23 */ 228 "dollar", /* 24 */ 229 "percent", /* 25 */ 230 "ampersand", /* 26 */ 231 "quotesingle", /* 27 */ 232 "parenleft", /* 28 */ 233 "parenright", /* 29 */ 234 "asterisk", /* 2A */ 235 "plus", /* 2B */ 236 "comma", /* 2C */ 237 "hyphen", /* 2D */ 238 "period", /* 2E */ 239 "slash", /* 2F */ 240 "zero", /* 30 */ 241 "one", /* 31 */ 242 "two", /* 32 */ 243 "three", /* 33 */ 244 "four", /* 34 */ 245 "five", /* 35 */ 246 "six", /* 36 */ 247 "seven", /* 37 */ 248 "eight", /* 38 */ 249 "nine", /* 39 */ 250 "colon", /* 3A */ 251 "semicolon", /* 3B */ 252 "less", /* 3C */ 253 "equal", /* 3D */ 254 "greater", /* 3E */ 255 "question", /* 3F */ 256 "at", /* 40 */ 257 "A", /* 41 */ 258 "B", /* 42 */ 259 "C", /* 43 */ 260 "D", /* 44 */ 261 "E", /* 45 */ 262 "F", /* 46 */ 263 "G", /* 47 */ 264 "H", /* 48 */ 265 "I", /* 49 */ 266 "J", /* 4A */ 267 "K", /* 4B */ 268 "L", /* 4C */ 269 "M", /* 4D */ 270 "N", /* 4E */ 271 "O", /* 4F */ 272 "P", /* 50 */ 273 "Q", /* 51 */ 274 "R", /* 52 */ 275 "S", /* 53 */ 276 "T", /* 54 */ 277 "U", /* 55 */ 278 "V", /* 56 */ 279 "W", /* 57 */ 280 "X", /* 58 */ 281 "Y", /* 59 */ 282 "Z", /* 5A */ 283 "bracketleft", /* 5B */ 284 "backslash", /* 5C */ 285 "bracketright", /* 5D */ 286 "asciicircum", /* 5E */ 287 "underscore", /* 5F */ 288 "grave", /* 60 */ 289 "a", /* 61 */ 290 "b", /* 62 */ 291 "c", /* 63 */ 292 "d", /* 64 */ 293 "e", /* 65 */ 294 "f", /* 66 */ 295 "g", /* 67 */ 296 "h", /* 68 */ 297 "i", /* 69 */ 298 "j", /* 6A */ 299 "k", /* 6B */ 300 "l", /* 6C */ 301 "m", /* 6D */ 302 "n", /* 6E */ 303 "o", /* 6F */ 304 "p", /* 70 */ 305 "q", /* 71 */ 306 "r", /* 72 */ 307 "s", /* 73 */ 308 "t", /* 74 */ 309 "u", /* 75 */ 310 "v", /* 76 */ 311 "w", /* 77 */ 312 "x", /* 78 */ 313 "y", /* 79 */ 314 "z", /* 7A */ 315 "braceleft", /* 7B */ 316 "bar", /* 7C */ 317 "braceright", /* 7D */ 318 "asciitilde", /* 7E */ 319 "W7f", /* 7F */ 320 "W80", /* 80 */ 321 "W81", /* 81 */ 322 "quotesinglbase", /* 82 */ 323 "florin", /* 83 */ 324 "quotedblbase", /* 84 */ 325 "ellipsis", /* 85 */ 326 "dagger", /* 86 */ 327 "daggerdbl", /* 87 */ 328 "circumflex", /* 88 */ /* ?? */ 329 "perthousand", /* 89 */ 330 "Scaron", /* 8A */ 331 "guilsinglleft", /* 8B */ 332 "OE", /* 8C */ 333 "W8d", /* 8D */ 334 "W8e", /* 8E */ 335 "W8f", /* 8F */ 336 "W90", /* 90 */ 337 "quoteleft", /* 91 */ 338 "quoteright", /* 92 */ 339 "quotedblleft", /* 93 */ 340 "quotedblright", /* 94 */ 341 "bullet", /* 95 */ 342 "endash", /* 96 */ 343 "emdash", /* 97 */ 344 "asciitilde", /* 98 */ /* ?? */ 345 "trademark", /* 99 */ 346 "scaron", /* 9A */ 347 "guilsinglright", /* 9B */ 348 "oe", /* 9C */ 349 "W9d", /* 9D */ 350 "W9e", /* 9E */ 351 "Ydieresis", /* 9F */ 352 "reqspace", /* A0 */ /* ?? */ 353 "exclamdown", /* A1 */ 354 "cent", /* A2 */ 355 "sterling", /* A3 */ 356 "currency", /* A4 */ 357 "yen", /* A5 */ 358 "brokenbar", /* A6 */ 359 "section", /* A7 */ 360 "dieresis", /* A8 */ 361 "copyright", /* A9 */ 362 "ordfeminine", /* AA */ 363 "guillemotleft", /* AB */ 364 "logicalnot", /* AC */ 365 "sfthyphen", /* AD */ 366 "registered", /* AE */ 367 "overstore", /* AF */ 368 "degree", /* B0 */ 369 "plusminus", /* B1 */ 370 "twosuperior", /* B2 */ 371 "threesuperior", /* B3 */ 372 "acute", /* B4 */ 373 "mu", /* B5 */ 374 "paragraph", /* B6 */ 375 "periodcentered", /* B7 */ 376 "cedilla", /* B8 */ 377 "onesuperior", /* B9 */ 378 "ordmasculine", /* BA */ 379 "guillemotright", /* BB */ 380 "onequarter", /* BC */ 381 "onehalf", /* BD */ 382 "threequarters", /* BE */ 383 "questiondown", /* BF */ 384 "Agrave", /* C0 */ 385 "Aacute", /* C1 */ 386 "Acircumflex", /* C2 */ 387 "Atilde", /* C3 */ 388 "Adieresis", /* C4 */ 389 "Aring", /* C5 */ 390 "AE", /* C6 */ 391 "Ccedilla", /* C7 */ 392 "Egrave", /* C8 */ 393 "Eacute", /* C9 */ 394 "Ecircumflex", /* CA */ 395 "Edieresis", /* CB */ 396 "Igrave", /* CC */ 397 "Iacute", /* CD */ 398 "Icircumflex", /* CE */ 399 "Idieresis", /* CF */ 400 "Eth", /* D0 */ 401 "Ntilde", /* D1 */ 402 "Ograve", /* D2 */ 403 "Oacute", /* D3 */ 404 "Ocircumflex", /* D4 */ 405 "Otilde", /* D5 */ 406 "Odieresis", /* D6 */ 407 "multiply", /* D7 */ 408 "Oslash", /* D8 */ 409 "Ugrave", /* D9 */ 410 "Uacute", /* DA */ 411 "Ucircumflex", /* DB */ 412 "Udieresis", /* DC */ 413 "Yacute", /* DD */ 414 "Thorn", /* DE */ 415 "germandbls", /* DF */ 416 "agrave", /* E0 */ 417 "aacute", /* E1 */ 418 "acircumflex", /* E2 */ 419 "atilde", /* E3 */ 420 "adieresis", /* E4 */ 421 "aring", /* E5 */ 422 "ae", /* E6 */ 423 "ccedilla", /* E7 */ 424 "egrave", /* E8 */ 425 "eacute", /* E9 */ 426 "ecircumflex", /* EA */ 427 "edieresis", /* EB */ 428 "igrave", /* EC */ 429 "iacute", /* ED */ 430 "icircumflex", /* EE */ 431 "idieresis", /* EF */ 432 "eth", /* F0 */ 433 "ntilde", /* F1 */ 434 "ograve", /* F2 */ 435 "oacute", /* F3 */ 436 "ocircumflex", /* F4 */ 437 "otilde", /* F5 */ 438 "odieresis", /* F6 */ 439 "divide", /* F7 */ 440 "oslash", /* F8 */ 441 "ugrave", /* F9 */ 442 "uacute", /* FA */ 443 "ucircumflex", /* FB */ 444 "udieresis", /* FC */ 445 "yacute", /* FD */ 446 "thorn", /* FE */ 447 "ydieresis", /* FF */ 448 };
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |