272 {
278
279
281
282 face_index =
FT_ABS( face_instance_index ) & 0xFFFF;
283
284
288
291 {
292
294
295
297
301
304 {
305
306 FT_ULong res_offset = mz_header.lfanew +
311
312
314
319
321
322
323
324
325
326
327
328
329 if ( size_shift > 16 )
330 {
331 FT_TRACE2((
"invalid alignment shift count for resource data\n" ));
333 goto Exit1;
334 }
335
336
337 for (;;)
338 {
340
341
344 break;
345
347
349 {
353 break;
354 }
355
357 }
358
360
361 if ( !font_count || !font_offset )
362 {
363 FT_TRACE2((
"this file doesn't contain any FNT resources\n" ));
366 }
367
368
369
371 {
372 FT_TRACE2((
"invalid number of faces\n" ));
375 }
376
377 face->root.num_faces = font_count;
378
379 if ( face_instance_index < 0 )
381
382 if ( face_index >= font_count )
383 {
386 }
387
390
394
397
399
401
403 }
405 {
411
412 FT_ULong root_dir_offset, name_dir_offset, lang_dir_offset;
414
415
417
421
422 FT_TRACE2((
"magic %04lx, machine %02x, number_of_sections %u, "
423 "size_of_optional_header %02x\n"
424 "magic32 %02x, rsrc_virtual_address %04lx, "
425 "rsrc_size %04lx\n",
431
433 pe32_header.
machine != 0x014C ||
436 {
437 FT_TRACE2((
"this file has an invalid PE header\n" ));
440 }
441
442 face->root.num_faces = 0;
443
445 {
447 &pe32_section ) )
449
450 FT_TRACE2((
"name %.8s, va %04lx, size %04lx, offset %04lx\n",
454
457 goto Found_rsrc_section;
458 }
459
460 FT_TRACE2((
"this file doesn't contain any resources\n" ));
463
464 Found_rsrc_section:
465 FT_TRACE2((
"found resources section %.8s\n", pe32_section.
name ));
466
470
472
473 for (
i = 0;
i <
root_dir.number_of_named_entries +
475 {
478 &dir_entry1 ) )
480
481 if ( !(dir_entry1.
offset & 0x80000000UL ) )
482 {
485 }
486
487 dir_entry1.
offset &= ~0x80000000UL;
488
491
496
499 {
502 &dir_entry2 ) )
504
505 if ( !(dir_entry2.
offset & 0x80000000UL ) )
506 {
509 }
510
511 dir_entry2.
offset &= ~0x80000000UL;
512
515
520
523 {
526 &dir_entry3 ) )
528
529 if ( dir_entry2.
offset & 0x80000000UL )
530 {
533 }
534
535 if ( dir_entry1.
name == 8 )
536 {
539 &data_entry ) )
541
542 FT_TRACE2((
"found font #%lu, offset %04lx, "
543 "size %04lx, cp %lu\n",
549
550 if ( face_index ==
face->root.num_faces )
551 {
554
558 face->font->fnt_size = data_entry.
size;
559
562 {
563 FT_TRACE2((
"font #%lu load error 0x%x\n",
566 }
567 else
568 FT_TRACE2((
"font #%lu successfully loaded\n",
570 }
571
572 face->root.num_faces++;
573 }
574 }
575 }
576 }
577 }
578
579 if ( !
face->root.num_faces )
580 {
581 FT_TRACE2((
"this file doesn't contain any RT_FONT resources\n" ));
584 }
585
586 if ( face_index >=
face->root.num_faces )
587 {
590 }
591 }
592
596
599
600 Exit1:
603 }
static const char root_dir[]
#define FT_TRACE2(varformat)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
#define FT_GET_USHORT_LE()
#define FT_STREAM_READ_FIELDS(fields, object)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
FT_ULong size_of_raw_data
FT_ULong pointer_to_raw_data
FT_UShort number_of_id_entries
FT_UShort number_of_named_entries
static const FT_Frame_Field winpe_rsrc_dir_fields[]
static const FT_Frame_Field winne_header_fields[]
static FT_Error fnt_font_load(FNT_Font font, FT_Stream stream)
static const FT_Frame_Field winpe32_header_fields[]
static const FT_Frame_Field winpe32_section_fields[]
static const FT_Frame_Field winmz_header_fields[]
static const FT_Frame_Field winpe_rsrc_data_entry_fields[]
static const FT_Frame_Field winpe_rsrc_dir_entry_fields[]
FT_BEGIN_HEADER struct WinMZ_HeaderRec_ WinMZ_HeaderRec