comparison TOOLS/subfont-c/subfont.c @ 13186:c70e7ad9ef7c

fix overcomplicated macros and a few warnings
author rathann
date Sat, 28 Aug 2004 20:53:01 +0000
parents 03d3ab9f6400
children c304e5836276
comparison
equal deleted inserted replaced
13185:628dd5d2326c 13186:c70e7ad9ef7c
72 static FT_ULong charcodes[max_charset_size]; /* character codes in 'encoding' */ 72 static FT_ULong charcodes[max_charset_size]; /* character codes in 'encoding' */
73 iconv_t cd; // iconv conversion descriptor 73 iconv_t cd; // iconv conversion descriptor
74 74
75 75
76 76
77 #define eprintf(...) fprintf(stderr, __VA_ARGS__) 77 #define eprintf(...) fprintf(stderr, ##__VA_ARGS__)
78 #define ERROR_(msg, ...) (eprintf("%s: error: " msg "\n", command, __VA_ARGS__), exit(1)) 78 #define ERROR(msg, ...) eprintf("%s: error: " msg "\n", command, ##__VA_ARGS__),exit(1)
79 #define WARNING_(msg, ...) eprintf("%s: warning: " msg "\n", command, __VA_ARGS__) 79 #define WARNING(msg, ...) eprintf("%s: warning: " msg "\n", command, ##__VA_ARGS__)
80 #define ERROR(...) ERROR_(__VA_ARGS__, NULL)
81 #define WARNING(...) WARNING_(__VA_ARGS__, NULL)
82
83 80
84 #define f266ToInt(x) (((x)+32)>>6) // round fractional fixed point number to integer 81 #define f266ToInt(x) (((x)+32)>>6) // round fractional fixed point number to integer
85 // coordinates are in 26.6 pixels (i.e. 1/64th of pixels) 82 // coordinates are in 26.6 pixels (i.e. 1/64th of pixels)
86 #define f266CeilToInt(x) (((x)+63)>>6) // ceiling 83 #define f266CeilToInt(x) (((x)+63)>>6) // ceiling
87 #define f266FloorToInt(x) ((x)>>6) // floor 84 #define f266FloorToInt(x) ((x)>>6) // floor
302 glyph_index = 0; 299 glyph_index = 0;
303 else { 300 else {
304 glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code); 301 glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code);
305 if (glyph_index==0) { 302 if (glyph_index==0) {
306 WARNING("Glyph for char 0x%02lx|U+%04lX|%c not found.", code, character, 303 WARNING("Glyph for char 0x%02lx|U+%04lX|%c not found.", code, character,
307 code<' '||code>255 ? '.':code); 304 code<' '||code>255 ? '.':(char)code);
308 continue; 305 continue;
309 } 306 }
310 } 307 }
311 308
312 // load glyph 309 // load glyph
366 363
367 /* font.desc */ 364 /* font.desc */
368 fprintf(f, "0x%04lx %i %i;\tU+%04lX|%c\n", unicode_desc ? character:code, 365 fprintf(f, "0x%04lx %i %i;\tU+%04lX|%c\n", unicode_desc ? character:code,
369 pen_x, // bitmap start 366 pen_x, // bitmap start
370 pen_xa-1, // bitmap end 367 pen_xa-1, // bitmap end
371 character, code<' '||code>255 ? '.':code); 368 character, code<' '||code>255 ? '.':(char)code);
372 #endif 369 #endif
373 pen_x = ALIGN(pen_xa); 370 pen_x = ALIGN(pen_xa);
374 } 371 }
375 372
376 373