comparison TOOLS/subfont-c/subfont.c @ 8451:fb88ccbc5ccc

compiler warning fixes based on patch by Dominik Mierzejewski <dominik@rangers.eu.org>
author arpi
date Sat, 14 Dec 2002 17:56:35 +0000
parents 94a56b859b04
children 072403f56892
comparison
equal deleted inserted replaced
8450:8cfc9309f0cc 8451:fb88ccbc5ccc
272 #endif 272 #endif
273 fprintf(f, "spacewidth %i\n", 2*padding + space_advance); 273 fprintf(f, "spacewidth %i\n", 2*padding + space_advance);
274 #ifndef NEW_DESC 274 #ifndef NEW_DESC
275 fprintf(f, "charspace %i\n", -2*padding); 275 fprintf(f, "charspace %i\n", -2*padding);
276 #endif 276 #endif
277 fprintf(f, "height %i\n", f266ToInt(face->size->metrics.height)); 277 fprintf(f, "height %li\n", f266ToInt(face->size->metrics.height));
278 #ifdef NEW_DESC 278 #ifdef NEW_DESC
279 fprintf(f, "ascender %i\n", f266CeilToInt(face->size->metrics.ascender)); 279 fprintf(f, "ascender %i\n", f266CeilToInt(face->size->metrics.ascender));
280 fprintf(f, "descender %i\n", f266FloorToInt(face->size->metrics.descender)); 280 fprintf(f, "descender %i\n", f266FloorToInt(face->size->metrics.descender));
281 #endif 281 #endif
282 } 282 }
301 if (character==0) 301 if (character==0)
302 glyph_index = 0; 302 glyph_index = 0;
303 else { 303 else {
304 glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code); 304 glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code);
305 if (glyph_index==0) { 305 if (glyph_index==0) {
306 WARNING("Glyph for char 0x%02x|U+%04X|%c not found.", code, character, 306 WARNING("Glyph for char 0x%02lx|U+%04lX|%c not found.", code, character,
307 code<' '||code>255 ? '.':code); 307 code<' '||code>255 ? '.':code);
308 continue; 308 continue;
309 } 309 }
310 } 310 }
311 311
312 // load glyph 312 // load glyph
313 error = FT_Load_Glyph(face, glyph_index, load_flags); 313 error = FT_Load_Glyph(face, glyph_index, load_flags);
314 if (error) { 314 if (error) {
315 WARNING("FT_Load_Glyph 0x%02x (char 0x%02x|U+%04X) failed.", glyph_index, code, character); 315 WARNING("FT_Load_Glyph 0x%02x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
316 continue; 316 continue;
317 } 317 }
318 slot = face->glyph; 318 slot = face->glyph;
319 319
320 // render glyph 320 // render glyph
321 if (slot->format != ft_glyph_format_bitmap) { 321 if (slot->format != ft_glyph_format_bitmap) {
322 error = FT_Render_Glyph(slot, ft_render_mode_normal); 322 error = FT_Render_Glyph(slot, ft_render_mode_normal);
323 if (error) { 323 if (error) {
324 WARNING("FT_Render_Glyph 0x%04x (char 0x%02x|U+%04X) failed.", glyph_index, code, character); 324 WARNING("FT_Render_Glyph 0x%04x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
325 continue; 325 continue;
326 } 326 }
327 } 327 }
328 328
329 // extract glyph image 329 // extract glyph image
330 error = FT_Get_Glyph(slot, (FT_Glyph*)&glyph); 330 error = FT_Get_Glyph(slot, (FT_Glyph*)&glyph);
331 if (error) { 331 if (error) {
332 WARNING("FT_Get_Glyph 0x%04x (char 0x%02x|U+%04X) failed.", glyph_index, code, character); 332 WARNING("FT_Get_Glyph 0x%04x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
333 continue; 333 continue;
334 } 334 }
335 glyphs[glyphs_count++] = (FT_Glyph)glyph; 335 glyphs[glyphs_count++] = (FT_Glyph)glyph;
336 336
337 #ifdef NEW_DESC 337 #ifdef NEW_DESC
363 363
364 /* advance pen */ 364 /* advance pen */
365 pen_xa = pen_x + f266ToInt(slot->advance.x) + 2*padding; 365 pen_xa = pen_x + f266ToInt(slot->advance.x) + 2*padding;
366 366
367 /* font.desc */ 367 /* font.desc */
368 fprintf(f, "0x%04x %i %i;\tU+%04X|%c\n", unicode_desc ? character:code, 368 fprintf(f, "0x%04lx %i %i;\tU+%04lX|%c\n", unicode_desc ? character:code,
369 pen_x, // bitmap start 369 pen_x, // bitmap start
370 pen_xa-1, // bitmap end 370 pen_xa-1, // bitmap end
371 character, code<' '||code>255 ? '.':code); 371 character, code<' '||code>255 ? '.':code);
372 #endif 372 #endif
373 pen_x = ALIGN(pen_xa); 373 pen_x = ALIGN(pen_xa);