273 {
279
280
282
283 face_index =
FT_ABS( face_instance_index ) & 0xFFFF;
284
285
289
292 {
293
295
296
298
302
305 {
306
307 FT_ULong res_offset = mz_header.lfanew +
312
313
315
320
322
323
324
325
326
327
328
329
330 if ( size_shift > 16 )
331 {
332 FT_TRACE2((
"invalid alignment shift count for resource data\n" ));
335 }
336
337
338 for (;;)
339 {
341
342
345 break;
346
348
350 {
354 break;
355 }
356
358 }
359
361
362 if ( !font_count || !font_offset )
363 {
364 FT_TRACE2((
"this file doesn't contain any FNT resources\n" ));
367 }
368
369
370
372 {
373 FT_TRACE2((
"invalid number of faces\n" ));
376 }
377
378 face->root.num_faces = font_count;
379
380 if ( face_instance_index < 0 )
382
383 if ( face_index >= font_count )
384 {
387 }
388
391
395
398
400
402
404 }
406 {
412
413 FT_ULong root_dir_offset, name_dir_offset, lang_dir_offset;
415
416
418
422
423 FT_TRACE2((
"magic %04lx, machine %02x, number_of_sections %u, "
424 "size_of_optional_header %02x\n"
425 "magic32 %02x, rsrc_virtual_address %04lx, "
426 "rsrc_size %04lx\n",
432
434 pe32_header.
machine != 0x014C ||
437 {
438 FT_TRACE2((
"this file has an invalid PE header\n" ));
441 }
442
443 face->root.num_faces = 0;
444
446 {
448 &pe32_section ) )
450
451 FT_TRACE2((
"name %.8s, va %04lx, size %04lx, offset %04lx\n",
455
458 goto Found_rsrc_section;
459 }
460
461 FT_TRACE2((
"this file doesn't contain any resources\n" ));
464
465 Found_rsrc_section:
466 FT_TRACE2((
"found resources section %.8s\n", pe32_section.
name ));
467
471
473
474 for (
i = 0;
i <
root_dir.number_of_named_entries +
476 {
479 &dir_entry1 ) )
481
482 if ( !(dir_entry1.
offset & 0x80000000UL ) )
483 {
486 }
487
488 dir_entry1.
offset &= ~0x80000000UL;
489
492
497
500 {
503 &dir_entry2 ) )
505
506 if ( !(dir_entry2.
offset & 0x80000000UL ) )
507 {
510 }
511
512 dir_entry2.
offset &= ~0x80000000UL;
513
516
521
524 {
527 &dir_entry3 ) )
529
530 if ( dir_entry2.
offset & 0x80000000UL )
531 {
534 }
535
536 if ( dir_entry1.
name == 8 )
537 {
540 &data_entry ) )
542
543 FT_TRACE2((
"found font #%lu, offset %04lx, "
544 "size %04lx, cp %lu\n",
550
551 if ( face_index ==
face->root.num_faces )
552 {
555
559 face->font->fnt_size = data_entry.
size;
560
563 {
564 FT_TRACE2((
"font #%lu load error 0x%x\n",
567 }
568 else
569 FT_TRACE2((
"font #%lu successfully loaded\n",
571 }
572
573 face->root.num_faces++;
574 }
575 }
576 }
577 }
578 }
579
580 if ( !
face->root.num_faces )
581 {
582 FT_TRACE2((
"this file doesn't contain any RT_FONT resources\n" ));
585 }
586
587 if ( face_index >=
face->root.num_faces )
588 {
591 }
592 }
593
597
600 }
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