19 #include FT_INTERNAL_DEBUG_H 20 #include FT_INTERNAL_CALC_H 21 #include FT_INTERNAL_STREAM_H 22 #include FT_INTERNAL_SFNT_H 23 #include FT_TRUETYPE_TAGS_H 29 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING 63 #define FAMILY_CLASS_RULES_SIZE 7 65 static const SPH_Font_Class FAMILY_CLASS_Rules
66 [FAMILY_CLASS_RULES_SIZE] =
93 "Fixed Miriam Transparent",
95 "Franklin Gothic Medium",
110 "Lucida Sans Unicode",
116 "Microsoft Sans Serif",
119 "Miriam Transparent",
128 "Simplified Arabic Fixed",
135 "Traditional Arabic",
144 {
"Core MS Legacy Fonts",
155 "Lucida Sans Unicode",
156 "Microsoft Sans Serif",
165 {
"Apple Legacy Fonts",
182 {
"Legacy Sans Fonts",
188 "Franklin Gothic Medium",
192 "Lucida Sans Unicode",
193 "Lucida Sans Typewriter",
194 "Microsoft Sans Serif",
203 {
"Misc Legacy Fonts",
204 {
"Dark Courier",
"", }, },
207 "Bitstream Vera Sans",
"", }, },
208 {
"Verdana and Clones",
210 "Bitstream Vera Sans",
223 #define STYLE_CLASS_RULES_SIZE 5 225 const SPH_Font_Class STYLE_CLASS_Rules
226 [STYLE_CLASS_RULES_SIZE] =
237 {
"Regular/Italic Class",
248 {
"Bold/BoldItalic Class",
255 {
"Bold/Italic/BoldItalic Class",
264 {
"Regular/Bold Class",
279 #define COMPATIBILITY_MODE_RULES_SIZE 1 281 const SPH_TweakRule COMPATIBILITY_MODE_Rules
282 [COMPATIBILITY_MODE_RULES_SIZE] =
289 #define PIXEL_HINTING_RULES_SIZE 1 291 const SPH_TweakRule PIXEL_HINTING_Rules
292 [PIXEL_HINTING_RULES_SIZE] =
302 #define SKIP_INLINE_DELTAS_RULES_SIZE 1 304 const SPH_TweakRule SKIP_INLINE_DELTAS_Rules
305 [SKIP_INLINE_DELTAS_RULES_SIZE] =
312 #define DO_SHPIX_RULES_SIZE 1 314 const SPH_TweakRule DO_SHPIX_Rules
315 [DO_SHPIX_RULES_SIZE] =
323 #define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 9 325 const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
326 [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
329 {
"Consolas", 0,
"Regular", 0 },
331 {
"Arial", 0,
"Regular",
'm' },
333 {
"Core MS Legacy Fonts", 0,
"Regular/Bold Class",
'N' },
334 {
"Lucida Grande", 0,
"",
'N' },
335 {
"Lucida Grande", 0,
"Bold",
'y' },
337 {
"Legacy Sans Fonts", 0,
"", 0x438 },
338 {
"Verdana Clones", 0,
"",
'N' },
340 {
"Verdana", 0,
"Bold",
'x' },
342 {
"Tahoma", 0,
"",
's' },
346 #define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 7 348 const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
349 [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
351 {
"Tahoma", 0,
"",
'N' },
352 {
"Comic Sans MS", 0,
"",
'N' },
353 {
"Verdana", 0,
"Regular/Bold Class",
'N' },
354 {
"Verdana", 11,
"Bold",
'x' },
356 {
"Arial", 0,
"", 0x438 },
357 {
"Arial", 11,
"Bold",
'N' },
358 {
"Trebuchet MS", 0,
"Bold", 0 },
363 #define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1 365 const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
366 [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
372 #define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 374 const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
375 [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
382 #define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2 384 const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
385 [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
388 {
"Droid Sans", 0,
"Regular/Italic Class", 0 },
389 {
"Droid Sans Mono", 0,
"", 0 },
393 #define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 395 const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
396 [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
403 #define ALLOW_X_DMOVEX_RULES_SIZE 1 405 const SPH_TweakRule ALLOW_X_DMOVEX_Rules
406 [ALLOW_X_DMOVEX_RULES_SIZE] =
408 {
"-", 0,
"Regular", 0 },
413 #define ALLOW_X_DMOVE_RULES_SIZE 1 415 const SPH_TweakRule ALLOW_X_DMOVE_Rules
416 [ALLOW_X_DMOVE_RULES_SIZE] =
419 {
"Verdana", 0,
"Regular",
'4' },
425 #define ALLOW_X_MOVE_ZP2_RULES_SIZE 1 427 const SPH_TweakRule ALLOW_X_MOVE_ZP2_Rules
428 [ALLOW_X_MOVE_ZP2_RULES_SIZE] =
435 #define RASTERIZER_35_RULES_SIZE 8 437 const SPH_TweakRule RASTERIZER_35_Rules
438 [RASTERIZER_35_RULES_SIZE] =
441 {
"Times New Roman", 0,
"Regular",
'i' },
442 {
"Times New Roman", 0,
"Regular",
'j' },
443 {
"Times New Roman", 0,
"Regular",
'm' },
444 {
"Times New Roman", 0,
"Regular",
'r' },
445 {
"Times New Roman", 0,
"Regular",
'a' },
446 {
"Times New Roman", 0,
"Regular",
'n' },
447 {
"Times New Roman", 0,
"Regular",
'p' },
448 {
"Times", 0,
"", 0 },
453 #define NORMAL_ROUND_RULES_SIZE 1 455 const SPH_TweakRule NORMAL_ROUND_Rules
456 [NORMAL_ROUND_RULES_SIZE] =
459 {
"Courier New", 0,
"", 0 },
464 #define SKIP_IUP_RULES_SIZE 1 466 const SPH_TweakRule SKIP_IUP_Rules
467 [SKIP_IUP_RULES_SIZE] =
469 {
"Arial", 13,
"Regular",
'a' },
474 #define MIAP_HACK_RULES_SIZE 1 476 const SPH_TweakRule MIAP_HACK_Rules
477 [MIAP_HACK_RULES_SIZE] =
479 {
"Geneva", 12,
"", 0 },
484 #define ALWAYS_SKIP_DELTAP_RULES_SIZE 15 486 const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
487 [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
489 {
"Georgia", 0,
"Regular",
'k' },
491 {
"Trebuchet MS", 14,
"Regular",
'e' },
492 {
"Trebuchet MS", 13,
"Regular",
'e' },
493 {
"Trebuchet MS", 15,
"Regular",
'e' },
494 {
"Arial", 11,
"Regular",
's' },
495 {
"Verdana", 10,
"Regular", 0 },
496 {
"Verdana", 9,
"Regular", 0 },
498 {
"Legacy Sans Fonts", 0,
"", 0x438 },
499 {
"Legacy Sans Fonts", 0,
"", 0x439 },
500 {
"Arial", 10,
"Regular",
'6' },
501 {
"Arial", 0,
"Bold/BoldItalic Class",
'a' },
503 {
"Arial", 24,
"Bold",
's' },
504 {
"Arial", 25,
"Bold",
's' },
505 {
"Arial", 24,
"Bold",
'a' },
506 {
"Arial", 25,
"Bold",
'a' },
511 #define ALWAYS_DO_DELTAP_RULES_SIZE 2 513 const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
514 [ALWAYS_DO_DELTAP_RULES_SIZE] =
516 {
"Verdana Clones", 17,
"Regular Class",
'K' },
517 {
"Verdana Clones", 17,
"Regular Class",
'k' },
522 #define DELTAP_RTG_RULES_SIZE 1 524 static const SPH_TweakRule DELTAP_RTG_Rules
525 [DELTAP_RTG_RULES_SIZE] =
532 #define MIRP_CVT_ZERO_RULES_SIZE 1 534 static const SPH_TweakRule MIRP_CVT_ZERO_Rules
535 [MIRP_CVT_ZERO_RULES_SIZE] =
542 #define DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE 1 544 static const SPH_TweakRule DELTAP_SKIP_EXAGGERATED_VALUES_Rules
545 [DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE] =
552 #define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 4 554 static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules
555 [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =
558 {
"Courier New", 0,
"Bold",
'C' },
559 {
"Courier New", 0,
"Bold",
'D' },
560 {
"Courier New", 0,
"Bold",
'Q' },
561 {
"Courier New", 0,
"Bold",
'0' },
566 #define NO_DELTAP_AFTER_IUP_RULES_SIZE 1 568 static const SPH_TweakRule NO_DELTAP_AFTER_IUP_Rules
569 [NO_DELTAP_AFTER_IUP_RULES_SIZE] =
576 #define NO_CALL_AFTER_IUP_RULES_SIZE 4 578 static const SPH_TweakRule NO_CALL_AFTER_IUP_Rules
579 [NO_CALL_AFTER_IUP_RULES_SIZE] =
582 {
"Courier New", 0,
"Bold",
'O' },
583 {
"Courier New", 0,
"Bold",
'Q' },
584 {
"Courier New", 0,
"Bold",
'k' },
585 {
"Courier New", 0,
"Bold Italic",
'M' },
590 #define DEEMBOLDEN_RULES_SIZE 9 592 static const SPH_TweakRule DEEMBOLDEN_Rules
593 [DEEMBOLDEN_RULES_SIZE] =
595 {
"Courier New", 0,
"Bold",
'A' },
596 {
"Courier New", 0,
"Bold",
'W' },
597 {
"Courier New", 0,
"Bold",
'w' },
598 {
"Courier New", 0,
"Bold",
'M' },
599 {
"Courier New", 0,
"Bold",
'X' },
600 {
"Courier New", 0,
"Bold",
'K' },
601 {
"Courier New", 0,
"Bold",
'x' },
602 {
"Courier New", 0,
"Bold",
'z' },
603 {
"Courier New", 0,
"Bold",
'v' },
608 #define EMBOLDEN_RULES_SIZE 5 610 static const SPH_TweakRule EMBOLDEN_Rules
611 [EMBOLDEN_RULES_SIZE] =
613 {
"Courier New", 12,
"Italic",
'z' },
614 {
"Courier New", 11,
"Italic",
'z' },
615 {
"Courier New", 10,
"Italic",
'z' },
616 {
"Courier New", 0,
"Regular", 0 },
617 {
"Courier New", 0,
"Italic", 0 },
622 #define DELTAP_RDTG_RULES_SIZE 1 624 static const SPH_TweakRule DELTAP_RDTG_Rules
625 [DELTAP_RDTG_RULES_SIZE] =
633 #define TIMES_NEW_ROMAN_HACK_RULES_SIZE 12 635 static const SPH_TweakRule TIMES_NEW_ROMAN_HACK_Rules
636 [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =
638 {
"Times New Roman", 16,
"Italic",
'2' },
639 {
"Times New Roman", 16,
"Italic",
'5' },
640 {
"Times New Roman", 16,
"Italic",
'7' },
641 {
"Times New Roman", 16,
"Regular",
'2' },
642 {
"Times New Roman", 16,
"Regular",
'5' },
643 {
"Times New Roman", 16,
"Regular",
'7' },
644 {
"Times New Roman", 17,
"Italic",
'2' },
645 {
"Times New Roman", 17,
"Italic",
'5' },
646 {
"Times New Roman", 17,
"Italic",
'7' },
647 {
"Times New Roman", 17,
"Regular",
'2' },
648 {
"Times New Roman", 17,
"Regular",
'5' },
649 {
"Times New Roman", 17,
"Regular",
'7' },
655 #define COURIER_NEW_2_HACK_RULES_SIZE 15 657 static const SPH_TweakRule COURIER_NEW_2_HACK_Rules
658 [COURIER_NEW_2_HACK_RULES_SIZE] =
660 {
"Courier New", 10,
"Regular",
'2' },
661 {
"Courier New", 11,
"Regular",
'2' },
662 {
"Courier New", 12,
"Regular",
'2' },
663 {
"Courier New", 13,
"Regular",
'2' },
664 {
"Courier New", 14,
"Regular",
'2' },
665 {
"Courier New", 15,
"Regular",
'2' },
666 {
"Courier New", 16,
"Regular",
'2' },
667 {
"Courier New", 17,
"Regular",
'2' },
668 {
"Courier New", 18,
"Regular",
'2' },
669 {
"Courier New", 19,
"Regular",
'2' },
670 {
"Courier New", 20,
"Regular",
'2' },
671 {
"Courier New", 21,
"Regular",
'2' },
672 {
"Courier New", 22,
"Regular",
'2' },
673 {
"Courier New", 23,
"Regular",
'2' },
674 {
"Courier New", 24,
"Regular",
'2' },
678 #ifndef FORCE_NATURAL_WIDTHS 683 #define COMPATIBLE_WIDTHS_RULES_SIZE 38 685 static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
686 [COMPATIBLE_WIDTHS_RULES_SIZE] =
688 {
"Arial Unicode MS", 12,
"Regular Class",
'm' },
689 {
"Arial Unicode MS", 14,
"Regular Class",
'm' },
691 {
"Arial", 10,
"Regular Class", 0x448 },
692 {
"Arial", 11,
"Regular Class",
'm' },
693 {
"Arial", 12,
"Regular Class",
'm' },
695 {
"Arial", 12,
"Regular Class", 0x448 },
696 {
"Arial", 13,
"Regular Class", 0x448 },
697 {
"Arial", 14,
"Regular Class",
'm' },
699 {
"Arial", 14,
"Regular Class", 0x448 },
700 {
"Arial", 15,
"Regular Class", 0x448 },
701 {
"Arial", 17,
"Regular Class",
'm' },
702 {
"DejaVu Sans", 15,
"Regular Class", 0 },
703 {
"Microsoft Sans Serif", 11,
"Regular Class", 0 },
704 {
"Microsoft Sans Serif", 12,
"Regular Class", 0 },
705 {
"Segoe UI", 11,
"Regular Class", 0 },
706 {
"Monaco", 0,
"Regular Class", 0 },
707 {
"Segoe UI", 12,
"Regular Class",
'm' },
708 {
"Segoe UI", 14,
"Regular Class",
'm' },
709 {
"Tahoma", 11,
"Regular Class", 0 },
710 {
"Times New Roman", 16,
"Regular Class",
'c' },
711 {
"Times New Roman", 16,
"Regular Class",
'm' },
712 {
"Times New Roman", 16,
"Regular Class",
'o' },
713 {
"Times New Roman", 16,
"Regular Class",
'w' },
714 {
"Trebuchet MS", 11,
"Regular Class", 0 },
715 {
"Trebuchet MS", 12,
"Regular Class", 0 },
716 {
"Trebuchet MS", 14,
"Regular Class", 0 },
717 {
"Trebuchet MS", 15,
"Regular Class", 0 },
718 {
"Ubuntu", 12,
"Regular Class",
'm' },
720 {
"Verdana", 10,
"Regular Class", 0x448 },
721 {
"Verdana", 11,
"Regular Class", 0x448 },
722 {
"Verdana and Clones", 12,
"Regular Class",
'i' },
723 {
"Verdana and Clones", 12,
"Regular Class",
'j' },
724 {
"Verdana and Clones", 12,
"Regular Class",
'l' },
725 {
"Verdana and Clones", 12,
"Regular Class",
'm' },
726 {
"Verdana and Clones", 13,
"Regular Class",
'i' },
727 {
"Verdana and Clones", 13,
"Regular Class",
'j' },
728 {
"Verdana and Clones", 13,
"Regular Class",
'l' },
729 {
"Verdana and Clones", 14,
"Regular Class",
'm' },
738 #define X_SCALING_RULES_SIZE 50 740 static const SPH_ScaleRule X_SCALING_Rules[X_SCALING_RULES_SIZE] =
742 {
"DejaVu Sans", 12,
"Regular Class",
'm', 950 },
743 {
"Verdana and Clones", 12,
"Regular Class",
'a', 1100 },
744 {
"Verdana and Clones", 13,
"Regular Class",
'a', 1050 },
745 {
"Arial", 11,
"Regular Class",
'm', 975 },
746 {
"Arial", 12,
"Regular Class",
'm', 1050 },
748 {
"Arial", 13,
"Regular Class", 0x43B, 950 },
749 {
"Arial", 13,
"Regular Class",
'o', 950 },
750 {
"Arial", 13,
"Regular Class",
'e', 950 },
751 {
"Arial", 14,
"Regular Class",
'm', 950 },
753 {
"Arial", 15,
"Regular Class", 0x43B, 925 },
754 {
"Bitstream Vera Sans", 10,
"Regular/Italic Class", 0, 1100 },
755 {
"Bitstream Vera Sans", 12,
"Regular/Italic Class", 0, 1050 },
756 {
"Bitstream Vera Sans", 16,
"Regular Class", 0, 1050 },
757 {
"Bitstream Vera Sans", 9,
"Regular/Italic Class", 0, 1050 },
758 {
"DejaVu Sans", 12,
"Regular Class",
'l', 975 },
759 {
"DejaVu Sans", 12,
"Regular Class",
'i', 975 },
760 {
"DejaVu Sans", 12,
"Regular Class",
'j', 975 },
761 {
"DejaVu Sans", 13,
"Regular Class",
'l', 950 },
762 {
"DejaVu Sans", 13,
"Regular Class",
'i', 950 },
763 {
"DejaVu Sans", 13,
"Regular Class",
'j', 950 },
764 {
"DejaVu Sans", 10,
"Regular/Italic Class", 0, 1100 },
765 {
"DejaVu Sans", 12,
"Regular/Italic Class", 0, 1050 },
766 {
"Georgia", 10,
"", 0, 1050 },
767 {
"Georgia", 11,
"", 0, 1100 },
768 {
"Georgia", 12,
"", 0, 1025 },
769 {
"Georgia", 13,
"", 0, 1050 },
770 {
"Georgia", 16,
"", 0, 1050 },
771 {
"Georgia", 17,
"", 0, 1030 },
772 {
"Liberation Sans", 12,
"Regular Class",
'm', 1100 },
773 {
"Lucida Grande", 11,
"Regular Class",
'm', 1100 },
774 {
"Microsoft Sans Serif", 11,
"Regular Class",
'm', 950 },
775 {
"Microsoft Sans Serif", 12,
"Regular Class",
'm', 1050 },
776 {
"Segoe UI", 12,
"Regular Class",
'H', 1050 },
777 {
"Segoe UI", 12,
"Regular Class",
'm', 1050 },
778 {
"Segoe UI", 14,
"Regular Class",
'm', 1050 },
779 {
"Tahoma", 11,
"Regular Class",
'i', 975 },
780 {
"Tahoma", 11,
"Regular Class",
'l', 975 },
781 {
"Tahoma", 11,
"Regular Class",
'j', 900 },
782 {
"Tahoma", 11,
"Regular Class",
'm', 918 },
783 {
"Verdana", 10,
"Regular/Italic Class", 0, 1100 },
784 {
"Verdana", 12,
"Regular Class",
'm', 975 },
785 {
"Verdana", 12,
"Regular/Italic Class", 0, 1050 },
786 {
"Verdana", 13,
"Regular/Italic Class",
'i', 950 },
787 {
"Verdana", 13,
"Regular/Italic Class",
'j', 950 },
788 {
"Verdana", 13,
"Regular/Italic Class",
'l', 950 },
789 {
"Verdana", 16,
"Regular Class", 0, 1050 },
790 {
"Verdana", 9,
"Regular/Italic Class", 0, 1050 },
791 {
"Times New Roman", 16,
"Regular Class",
'm', 918 },
792 {
"Trebuchet MS", 11,
"Regular Class",
'm', 800 },
793 {
"Trebuchet MS", 12,
"Regular Class",
'm', 800 },
798 #define COMPATIBLE_WIDTHS_RULES_SIZE 1 800 static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
801 [COMPATIBLE_WIDTHS_RULES_SIZE] =
807 #define X_SCALING_RULES_SIZE 1 809 static const SPH_ScaleRule X_SCALING_Rules
810 [X_SCALING_RULES_SIZE] =
812 {
"-", 0,
"", 0, 1000 },
819 is_member_of_family_class(
const FT_String* detected_font_name,
826 if ( strcmp( detected_font_name, rule_font_name ) == 0 )
830 if ( strcmp( rule_font_name,
"" ) == 0 )
834 for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )
836 if ( strcmp( FAMILY_CLASS_Rules[i].
name, rule_font_name ) == 0 )
838 for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
840 if ( strcmp( FAMILY_CLASS_Rules[i].member[j],
"" ) == 0 )
842 if ( strcmp( FAMILY_CLASS_Rules[i].member[j],
843 detected_font_name ) == 0 )
854 is_member_of_style_class(
const FT_String* detected_font_style,
861 if ( strcmp( detected_font_style, rule_font_style ) == 0 )
865 if ( strcmp( rule_font_style,
"" ) == 0 )
869 for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )
871 if ( strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
873 for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
875 if ( strcmp( STYLE_CLASS_Rules[i].member[j],
"" ) == 0 )
877 if ( strcmp( STYLE_CLASS_Rules[i].member[j],
878 detected_font_style ) == 0 )
894 const SPH_TweakRule* rule,
901 for ( i = 0; i < num_rules; i++ )
904 ( is_member_of_family_class ( family, rule[i].family ) ) )
905 if ( rule[i].ppem == 0 ||
906 rule[i].ppem == ppem )
908 is_member_of_style_class ( style, rule[i].style ) )
909 if ( rule[i].glyph == 0 ||
911 rule[i].glyph ) == glyph_index )
920 scale_test_tweak(
TT_Face face,
925 const SPH_ScaleRule* rule,
932 for ( i = 0; i < num_rules; i++ )
935 ( is_member_of_family_class ( family, rule[i].family ) ) )
936 if ( rule[i].ppem == 0 ||
937 rule[i].ppem == ppem )
939 is_member_of_style_class( style, rule[i].style ) )
940 if ( rule[i].glyph == 0 ||
942 rule[i].glyph ) == glyph_index )
943 return rule[
i].scale;
951 sph_test_tweak_x_scaling(
TT_Face face,
957 return scale_test_tweak( face, family, ppem, style, glyph_index,
958 X_SCALING_Rules, X_SCALING_RULES_SIZE );
962 #define TWEAK_RULES( x ) \ 963 if ( sph_test_tweak( face, family, ppem, style, glyph_index, \ 964 x##_Rules, x##_RULES_SIZE ) ) \ 965 loader->exec->sph_tweak_flags |= SPH_TWEAK_##x; 967 #define TWEAK_RULES_EXCEPTIONS( x ) \ 968 if ( sph_test_tweak( face, family, ppem, style, glyph_index, \ 969 x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \ 970 loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x; 987 #ifdef SPH_DEBUG_MORE_VERBOSE 988 printf(
"%s,%d,%s,%c=%d ",
989 family, ppem, style, glyph_index, glyph_index );
992 TWEAK_RULES( PIXEL_HINTING );
994 if ( loader->
exec->sph_tweak_flags & SPH_TWEAK_PIXEL_HINTING )
1000 TWEAK_RULES( ALLOW_X_DMOVE );
1001 TWEAK_RULES( ALLOW_X_DMOVEX );
1002 TWEAK_RULES( ALLOW_X_MOVE_ZP2 );
1003 TWEAK_RULES( ALWAYS_DO_DELTAP );
1004 TWEAK_RULES( ALWAYS_SKIP_DELTAP );
1005 TWEAK_RULES( DEEMBOLDEN );
1006 TWEAK_RULES( DELTAP_SKIP_EXAGGERATED_VALUES );
1007 TWEAK_RULES( DO_SHPIX );
1008 TWEAK_RULES( EMBOLDEN );
1009 TWEAK_RULES( MIAP_HACK );
1010 TWEAK_RULES( NORMAL_ROUND );
1011 TWEAK_RULES( NO_ALIGNRP_AFTER_IUP );
1012 TWEAK_RULES( NO_CALL_AFTER_IUP );
1013 TWEAK_RULES( NO_DELTAP_AFTER_IUP );
1014 TWEAK_RULES( RASTERIZER_35 );
1015 TWEAK_RULES( SKIP_INLINE_DELTAS );
1016 TWEAK_RULES( SKIP_IUP );
1017 TWEAK_RULES( MIRP_CVT_ZERO );
1019 TWEAK_RULES( SKIP_OFFPIXEL_Y_MOVES );
1020 TWEAK_RULES_EXCEPTIONS( SKIP_OFFPIXEL_Y_MOVES );
1022 TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES );
1023 TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES );
1025 TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );
1026 TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );
1028 if ( loader->
exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
1030 if ( loader->
exec->rasterizer_version != 35 )
1032 loader->
exec->rasterizer_version = 35;
1035 tt_size_ready_bytecode(
1040 loader->
exec->rasterizer_version = 35;
1044 if ( loader->
exec->rasterizer_version !=
1045 SPH_OPTION_SET_RASTERIZER_VERSION )
1047 loader->
exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
1050 tt_size_ready_bytecode(
1055 loader->
exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
1060 TWEAK_RULES( TIMES_NEW_ROMAN_HACK );
1061 TWEAK_RULES( COURIER_NEW_2_HACK );
1064 if ( sph_test_tweak( face, family, ppem, style, glyph_index,
1065 COMPATIBILITY_MODE_Rules, COMPATIBILITY_MODE_RULES_SIZE ) )
1071 if ( sph_test_tweak( face, family, ppem, style, glyph_index,
1072 COMPATIBLE_WIDTHS_Rules, COMPATIBLE_WIDTHS_RULES_SIZE ) )
1073 loader->
exec->compatible_widths |=
TRUE;
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
struct TT_FaceRec_ * TT_Face
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
GLuint const GLchar * name
if(!abbox) return FT_THROW(Invalid_Argument)