354 {
358
361
364
365
367
370
375
378 {
381 }
384
385
387
388
389
390
391
392
393
394 if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
395 {
396 FT_ERROR((
"BDF_Face_Init: invalid face index\n" ));
398 return FT_THROW( Invalid_Argument );
399 }
400
401 {
403
404
405 FT_TRACE4((
" number of glyphs: allocated %d (used %d)\n",
407 font->glyphs_used ));
408 FT_TRACE4((
" number of unencoded glyphs: allocated %d (used %d)\n",
409 font->unencoded_size,
410 font->unencoded_used ));
411
414
417
424
425
426
427
430 {
433 }
434 else
436
439
440
441
443
447
448 {
450 FT_Short resolution_x = 0, resolution_y = 0;
452
453
455
456
457 if (
font->font_ascent > 0x7FFF ||
font->font_ascent < -0x7FFF )
458 {
459 font->font_ascent =
font->font_ascent < 0 ? -0x7FFF : 0x7FFF;
460 FT_TRACE0((
"BDF_Face_Init: clamping font ascent to value %d\n",
461 font->font_ascent ));
462 }
463 if (
font->font_descent > 0x7FFF ||
font->font_descent < -0x7FFF )
464 {
465 font->font_descent =
font->font_descent < 0 ? -0x7FFF : 0x7FFF;
466 FT_TRACE0((
"BDF_Face_Init: clamping font descent to value %d\n",
467 font->font_descent ));
468 }
469
471
473 if ( prop )
474 {
475#ifdef FT_DEBUG_LEVEL_TRACE
477 FT_TRACE0((
"BDF_Face_Init: negative average width\n" ));
478#endif
479 if ( prop->
value.
l > 0x7FFFL * 10 - 5 ||
480 prop->
value.
l < -( 0x7FFFL * 10 - 5 ) )
481 {
482 bsize->
width = 0x7FFF;
483 FT_TRACE0((
"BDF_Face_Init: clamping average width to value %d\n",
485 }
486 else
488 }
489 else
490 {
491
493 }
494
496 if ( prop )
497 {
498#ifdef FT_DEBUG_LEVEL_TRACE
500 FT_TRACE0((
"BDF_Face_Init: negative point size\n" ));
501#endif
502
503 if ( prop->
value.
l > 0x504C2L ||
504 prop->
value.
l < -0x504C2L )
505 {
506 bsize->
size = 0x7FFF;
507 FT_TRACE0((
"BDF_Face_Init: clamping point size to value %d\n",
509 }
510 else
512 64 * 7200,
513 72270L );
514 }
515 else if (
font->point_size )
516 {
517 if (
font->point_size > 0x7FFF )
518 {
519 bsize->
size = 0x7FFF;
520 FT_TRACE0((
"BDF_Face_Init: clamping point size to value %d\n",
522 }
523 else
525 }
526 else
527 {
528
530 }
531
533 if ( prop )
534 {
535#ifdef FT_DEBUG_LEVEL_TRACE
537 FT_TRACE0((
"BDF_Face_Init: negative pixel size\n" ));
538#endif
539 if ( prop->
value.
l > 0x7FFF || prop->
value.
l < -0x7FFF )
540 {
541 bsize->
y_ppem = 0x7FFF << 6;
542 FT_TRACE0((
"BDF_Face_Init: clamping pixel size to value %d\n",
544 }
545 else
547 }
548
550 if ( prop )
552 else
555 {
556#ifdef FT_DEBUG_LEVEL_TRACE
558 FT_TRACE0((
"BDF_Face_Init: negative X resolution\n" ));
559#endif
561 {
562 resolution_x = 0x7FFF;
563 FT_TRACE0((
"BDF_Face_Init: clamping X resolution to value %d\n",
564 resolution_x ));
565 }
566 else
568 }
569
571 if ( prop )
573 else
576 {
577#ifdef FT_DEBUG_LEVEL_TRACE
579 FT_TRACE0((
"BDF_Face_Init: negative Y resolution\n" ));
580#endif
582 {
583 resolution_y = 0x7FFF;
584 FT_TRACE0((
"BDF_Face_Init: clamping Y resolution to value %d\n",
585 resolution_y ));
586 }
587 else
589 }
590
592 {
594 if ( resolution_y )
596 }
597 if ( resolution_x && resolution_y )
599 resolution_x,
600 resolution_y );
601 else
603 }
604
605
606 {
609
610
613
614 face->default_glyph = 0;
615 for (
n = 0;
n <
font->glyphs_size;
n++ )
616 {
620
622 {
625 else
627 " idx %d is too large for this system\n",
n ));
628 }
629 }
630 }
631
632
633 {
636
637
638 charset_registry =
640 charset_encoding =
642 if ( charset_registry && charset_encoding )
643 {
648 {
650
651
657
658
659
660 s =
face->charset_registry;
661 if ( (
s[0] ==
'i' ||
s[0] ==
'I' ) &&
662 (
s[1] ==
's' ||
s[1] ==
'S' ) &&
663 (
s[2] ==
'o' ||
s[2] ==
'O' ) )
664 {
669 unicode_charmap = 1;
670
673 unicode_charmap = 1;
674 }
675
676 {
678
679
681 charmap.
encoding = FT_ENCODING_NONE;
682
685
686 if ( unicode_charmap )
687 {
688 charmap.
encoding = FT_ENCODING_UNICODE;
691 }
692
694 }
695
697 }
698 }
699
700
701
702 {
704
705
707 charmap.
encoding = FT_ENCODING_ADOBE_STANDARD;
710
712
713
716 }
717 }
718 }
719
722
725 return FT_THROW( Unknown_File_Format );
726 }
bdf_get_font_property(bdf_font_t *font, const char *name)
bdf_load_font(FT_Stream stream, FT_Memory memory, bdf_options_t *opts, bdf_font_t **font)
BDF_Face_Done(FT_Face bdfface)
static FT_Error bdf_interpret_style(BDF_Face bdf)
static const FT_CMap_ClassRec bdf_cmap_class
#define TT_MS_ID_UNICODE_CS
#define TT_PLATFORM_MICROSOFT
#define TT_APPLE_ID_DEFAULT
#define TT_PLATFORM_APPLE_UNICODE
#define FT_FACE_FLAG_FIXED_SIZES
#define FT_FACE_FLAG_FIXED_WIDTH
#define FT_FACE_FLAG_HORIZONTAL
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE2(varformat)
#define FT_TRACE4(varformat)
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_NEW_ARRAY(ptr, count)
#define FT_STRDUP(dst, str)
#define FT_SET_ERROR(expression)
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
#define FT_STREAM_SEEK(position)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum const GLfloat * params
union bdf_property_t_::@4364 value
#define TT_ADOBE_ID_STANDARD
#define TT_PLATFORM_ADOBE