1 /***************************************************************************/
5 /* TrueType Subpixel Hinting. */
7 /* Copyright 2010-2012 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
19 #ifndef __TTSUBPIX_H__
20 #define __TTSUBPIX_H__
30 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
32 /*************************************************************************/
34 /* Tweak flags that are set for each glyph by the below rules. */
37 #define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001
38 #define SPH_TWEAK_ALLOW_X_DMOVEX 0x0000002
39 #define SPH_TWEAK_ALLOW_X_MOVE_ZP2 0x0000004
40 #define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000008
41 #define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000010
42 #define SPH_TWEAK_COURIER_NEW_2_HACK 0x0000020
43 #define SPH_TWEAK_DEEMBOLDEN 0x0000040
44 #define SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES 0x0000080
45 #define SPH_TWEAK_DO_SHPIX 0x0000100
46 #define SPH_TWEAK_EMBOLDEN 0x0000200
47 #define SPH_TWEAK_MIAP_HACK 0x0000400
48 #define SPH_TWEAK_NORMAL_ROUND 0x0000800
49 #define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP 0x0001000
50 #define SPH_TWEAK_NO_CALL_AFTER_IUP 0x0002000
51 #define SPH_TWEAK_NO_DELTAP_AFTER_IUP 0x0004000
52 #define SPH_TWEAK_PIXEL_HINTING 0x0008000
53 #define SPH_TWEAK_RASTERIZER_35 0x0010000
54 #define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES 0x0020000
55 #define SPH_TWEAK_SKIP_INLINE_DELTAS 0x0040000
56 #define SPH_TWEAK_SKIP_IUP 0x0080000
57 #define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES 0x0100000
58 #define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES 0x0200000
59 #define SPH_TWEAK_TIMES_NEW_ROMAN_HACK 0x0400000
60 #define SPH_TWEAK_MIRP_CVT_ZERO 0x0800000
64 sph_test_tweak( TT_Face face,
72 FT_LOCAL_DEF( FT_UInt )
73 scale_test_tweak( TT_Face face,
82 sph_set_tweaks( TT_Loader loader,
83 FT_UInt glyph_index );
86 /*************************************************************************/
88 /* These rules affect how the TT Interpreter does hinting, with the */
89 /* goal of doing subpixel hinting by (in general) ignoring x moves. */
90 /* Some of these rules are fixes that go above and beyond the */
91 /* stated techniques in the MS whitepaper on Cleartype, due to */
92 /* artifacts in many glyphs. So, these rules make some glyphs render */
93 /* better than they do in the MS rasterizer. */
95 /* "" string or 0 int/char indicates to apply to all glyphs. */
96 /* "-" used as dummy placeholders, but any non-matching string works. */
98 /* Some of this could arguably be implemented in fontconfig, however: */
100 /* - Fontconfig can't set things on a glyph-by-glyph basis. */
101 /* - The tweaks that happen here are very low-level, from an average */
102 /* user's point of view and are best implemented in the hinter. */
104 /* The goal is to make the subpixel hinting techniques as generalized */
105 /* as possible across all fonts to prevent the need for extra rules such */
108 /* The rule structure is designed so that entirely new rules can easily */
109 /* be added when a new compatibility feature is discovered. */
111 /* The rule structures could also use some enhancement to handle ranges. */
113 /* ****************** WORK IN PROGRESS ******************* */
116 /* These macros are defined absent a method for setting them */
117 #define SPH_OPTION_BITMAP_WIDTHS FALSE
118 #define SPH_OPTION_SET_SUBPIXEL TRUE
119 #define SPH_OPTION_SET_GRAYSCALE FALSE
120 #define SPH_OPTION_SET_COMPATIBLE_WIDTHS FALSE
121 #define SPH_OPTION_SET_RASTERIZER_VERSION 38
124 /* Define this to force natural (i.e. not bitmap-compatible) widths. */
125 /* The default leans strongly towards natural widths except for a few */
126 /* legacy fonts where a selective combination produces nicer results. */
127 /* #define FORCE_NATURAL_WIDTHS */
130 /* These are `classes' of fonts that can be grouped together and used in */
131 /* rules below. A blank entry "" is required at the end of these! */
132 #define FAMILY_CLASS_RULES_SIZE 7
134 Font_Class FAMILY_CLASS_Rules
135 [FAMILY_CLASS_RULES_SIZE] =
143 "Arabic Transparent",
162 "Fixed Miriam Transparent",
164 "Franklin Gothic Medium",
179 "Lucida Sans Unicode",
185 "Microsoft Sans Serif",
188 "Miriam Transparent",
197 "Simplified Arabic Fixed",
204 "Traditional Arabic",
213 { "Core MS Legacy Fonts",
224 "Lucida Sans Unicode",
225 "Microsoft Sans Serif",
234 { "Apple Legacy Fonts",
251 { "Legacy Sans Fonts",
257 "Franklin Gothic Medium",
261 "Lucida Sans Unicode",
262 "Lucida Sans Typewriter",
263 "Microsoft Sans Serif",
272 { "Misc Legacy Fonts",
273 { "Dark Courier", "", }, },
276 "Bitstream Vera Sans", "", }, },
277 { "Verdana and Clones",
279 "Bitstream Vera Sans",
284 /* Define `classes' of styles that can be grouped together and used in */
285 /* rules below. A blank entry "" is required at the end of these! */
286 #define STYLE_CLASS_RULES_SIZE 5
288 Font_Class STYLE_CLASS_Rules
289 [STYLE_CLASS_RULES_SIZE] =
300 { "Regular/Italic Class",
311 { "Bold/BoldItalic Class",
318 { "Bold/Italic/BoldItalic Class",
327 { "Regular/Bold Class",
341 /* Special fixes for known legacy fonts; */
342 /* this is the primary workhorse rule for legacy fonts */
343 #define COMPATIBILITY_MODE_RULES_SIZE 4
345 SPH_TweakRule COMPATIBILITY_MODE_Rules
346 [COMPATIBILITY_MODE_RULES_SIZE] =
348 { "MS Legacy Fonts", 0, "", 0 },
349 { "Apple Legacy Fonts", 0, "", 0 },
350 { "Misc Legacy Fonts", 0, "", 0 },
351 { "Verdana Clones", 0, "", 0 },
355 /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */
356 #define PIXEL_HINTING_RULES_SIZE 4
358 SPH_TweakRule PIXEL_HINTING_Rules
359 [PIXEL_HINTING_RULES_SIZE] =
361 /* these characters are almost always safe */
364 /* fixes the vanishing stem */
365 { "Times New Roman", 0, "Bold", 'A' },
366 { "Times New Roman", 0, "Bold", 'V' },
370 /* According to Greg Hitchcock and the MS whitepaper, this should work */
371 /* on all legacy MS fonts, but creates artifacts with some. Only using */
372 /* where absolutely necessary. */
373 #define SKIP_INLINE_DELTAS_RULES_SIZE 1
375 SPH_TweakRule SKIP_INLINE_DELTAS_Rules
376 [SKIP_INLINE_DELTAS_RULES_SIZE] =
382 /* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */
383 #define DO_SHPIX_RULES_SIZE 1
385 SPH_TweakRule DO_SHPIX_Rules
386 [DO_SHPIX_RULES_SIZE] =
392 /* Skip Y moves that start with a point that is not on a Y pixel */
393 /* boundary and don't move that point to a Y pixel boundary. */
394 #define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 10
396 SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
397 [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
399 /* fix vwxyz thinness*/
400 { "Consolas", 0, "Regular", 0 },
401 /* fix tiny gap at top of m */
402 { "Arial", 0, "Regular", 'm' },
403 /* Fix thin middle stems */
404 { "Core MS Legacy Fonts", 0, "Regular/Bold Class", 'N' },
405 { "Lucida Grande", 0, "", 'N' },
406 { "Lucida Grande", 0, "Bold", 'y' },
407 /* Cyrillic small letter I */
408 { "Legacy Sans Fonts", 0, "", 0x438 },
409 { "Verdana Clones", 0, "",'N' },
410 { "Ubuntu", 0, "Regular Class", 'N' },
411 /* Fix misshapen x */
412 { "Verdana", 0, "Bold", 'x' },
413 /* Fix misshapen s */
414 { "Tahoma", 0, "", 's' },
418 #define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 6
420 SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
421 [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
423 { "Tahoma", 0, "", 'N' },
424 { "Comic Sans MS", 0, "", 'N' },
425 { "Verdana", 0, "Regular/Bold Class", 'N' },
426 { "Verdana", 11, "Bold", 'x' },
427 /* Cyrillic small letter I */
428 { "Arial", 0, "", 0x438 },
429 { "Trebuchet MS", 0, "Bold", 0 },
433 /* Skip Y moves that move a point off a Y pixel boundary. */
434 /* This fixes Tahoma, Trebuchet oddities and some issues with `$'. */
435 #define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 5
437 SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
438 [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
440 { "MS Legacy Fonts", 0, "", 0 },
441 { "Apple Legacy Fonts", 0, "", 0 },
442 { "Misc Legacy Fonts", 0, "", 0 },
443 { "Ubuntu", 0, "Regular Class", 0 },
444 { "Verdana Clones", 0, "", 0 },
448 #define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
450 SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
451 [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
457 /* Round moves that don't move a point to a Y pixel boundary. */
458 #define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 3
460 SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
461 [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
463 /* Droid font instructions don't snap Y to pixels */
464 { "Droid Sans", 0, "Regular/Italic Class", 0 },
465 { "Droid Sans Mono", 0, "", 0 },
466 { "Ubuntu", 0, "", 0 },
470 #define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 3
472 SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
473 [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
475 { "Droid Sans", 12, "Bold", 0 },
476 { "Droid Sans", 13, "Bold", 0 },
477 { "Droid Sans", 16, "Bold", 0 },
481 /* Allow a Direct_Move_X along X freedom vector if matched. */
482 #define ALLOW_X_DMOVEX_RULES_SIZE 1
484 SPH_TweakRule ALLOW_X_DMOVEX_Rules
485 [ALLOW_X_DMOVEX_RULES_SIZE] =
487 { "-", 0, "Regular", 0 },
491 /* Allow a Direct_Move along X freedom vector if matched. */
492 #define ALLOW_X_DMOVE_RULES_SIZE 1
494 SPH_TweakRule ALLOW_X_DMOVE_Rules
495 [ALLOW_X_DMOVE_RULES_SIZE] =
497 /* Fixes vanishing diagonal in 4 */
498 { "Verdana", 0, "Regular", '4' },
502 /* Allow a ZP2 move along freedom vector if matched; */
503 /* This is called from SHP, SHPIX, SHC, SHZ. */
504 #define ALLOW_X_MOVE_ZP2_RULES_SIZE 1
506 SPH_TweakRule ALLOW_X_MOVE_ZP2_Rules
507 [ALLOW_X_MOVE_ZP2_RULES_SIZE] =
513 /* Return MS rasterizer version 35 if matched. */
514 #define RASTERIZER_35_RULES_SIZE 8
516 SPH_TweakRule RASTERIZER_35_Rules
517 [RASTERIZER_35_RULES_SIZE] =
519 /* This seems to be the only way to make these look good */
520 { "Times New Roman", 0, "Regular", 'i' },
521 { "Times New Roman", 0, "Regular", 'j' },
522 { "Times New Roman", 0, "Regular", 'm' },
523 { "Times New Roman", 0, "Regular", 'r' },
524 { "Times New Roman", 0, "Regular", 'a' },
525 { "Times New Roman", 0, "Regular", 'n' },
526 { "Times New Roman", 0, "Regular", 'p' },
527 { "Times", 0, "", 0 },
531 /* Don't round to the subpixel grid. Round to pixel grid. */
532 #define NORMAL_ROUND_RULES_SIZE 2
534 SPH_TweakRule NORMAL_ROUND_Rules
535 [NORMAL_ROUND_RULES_SIZE] =
537 /* Fix point "explosions" */
538 { "Courier New", 0, "", 0 },
539 { "Verdana", 10, "Regular", '4' },
543 /* Skip IUP instructions if matched. */
544 #define SKIP_IUP_RULES_SIZE 1
546 SPH_TweakRule SKIP_IUP_Rules
547 [SKIP_IUP_RULES_SIZE] =
549 { "Arial", 13, "Regular", 'a' },
553 /* Skip MIAP Twilight hack if matched. */
554 #define MIAP_HACK_RULES_SIZE 1
556 SPH_TweakRule MIAP_HACK_Rules
557 [MIAP_HACK_RULES_SIZE] =
559 { "Geneva", 12, "", 0 },
563 /* Skip DELTAP instructions if matched. */
564 #define ALWAYS_SKIP_DELTAP_RULES_SIZE 16
566 SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
567 [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
569 { "Georgia", 0, "Regular", 'k' },
570 /* fixes problems with W M w */
571 { "Trebuchet MS", 0, "Italic", 0 },
572 /* fix various problems with e in different versions */
573 { "Trebuchet MS", 14, "Regular", 'e' },
574 { "Trebuchet MS", 13, "Regular", 'e' },
575 { "Trebuchet MS", 15, "Regular", 'e' },
576 { "Arial", 11, "Regular", 's' },
577 { "Verdana", 10, "Regular", 0 },
578 { "Verdana", 9, "Regular", 0 },
579 /* Cyrillic small letter short I */
580 { "Legacy Sans Fonts", 0, "", 0x438 },
581 { "Legacy Sans Fonts", 0, "", 0x439 },
582 { "Arial", 10, "Regular", '6' },
583 { "Arial", 0, "Bold/BoldItalic Class", 'a' },
584 /* Make horizontal stems consistent with the rest */
585 { "Arial", 24, "Bold", 's' },
586 { "Arial", 25, "Bold", 's' },
587 { "Arial", 24, "Bold", 'a' },
588 { "Arial", 25, "Bold", 'a' },
592 /* Always do DELTAP instructions if matched. */
593 #define ALWAYS_DO_DELTAP_RULES_SIZE 2
595 SPH_TweakRule ALWAYS_DO_DELTAP_Rules
596 [ALWAYS_DO_DELTAP_RULES_SIZE] =
598 { "Verdana Clones", 17, "Regular Class", 'K' },
599 { "Verdana Clones", 17, "Regular Class", 'k' },
603 /* Do an extra RTG instruction in DELTAP if matched. */
604 #define DELTAP_RTG_RULES_SIZE 1
606 SPH_TweakRule DELTAP_RTG_Rules
607 [DELTAP_RTG_RULES_SIZE] =
613 /* Force CVT distance to zero in MIRP. */
614 #define MIRP_CVT_ZERO_RULES_SIZE 1
616 SPH_TweakRule MIRP_CVT_ZERO_Rules
617 [MIRP_CVT_ZERO_RULES_SIZE] =
623 /* Skip moves that meet or exceed 1 pixel. */
624 #define DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE 1
626 SPH_TweakRule DELTAP_SKIP_EXAGGERATED_VALUES_Rules
627 [DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE] =
629 /* Fix vanishing stems */
630 { "Ubuntu", 0, "Regular", 'M' },
634 /* Don't allow ALIGNRP after IUP. */
635 #define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 4
637 SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules
638 [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =
640 /* Prevent creation of dents in outline */
641 { "Courier New", 0, "Bold", 'C' },
642 { "Courier New", 0, "Bold", 'D' },
643 { "Courier New", 0, "Bold", 'Q' },
644 { "Courier New", 0, "Bold", '0' },
648 /* Don't allow DELTAP after IUP. */
649 #define NO_DELTAP_AFTER_IUP_RULES_SIZE 2
651 SPH_TweakRule NO_DELTAP_AFTER_IUP_Rules
652 [NO_DELTAP_AFTER_IUP_RULES_SIZE] =
654 { "Arial", 0, "Bold", 'N' },
655 { "Verdana", 0, "Regular", '4' },
659 /* Don't allow CALL after IUP. */
660 #define NO_CALL_AFTER_IUP_RULES_SIZE 4
662 SPH_TweakRule NO_CALL_AFTER_IUP_Rules
663 [NO_CALL_AFTER_IUP_RULES_SIZE] =
665 /* Prevent creation of dents in outline */
666 { "Courier New", 0, "Bold", 'O' },
667 { "Courier New", 0, "Bold", 'Q' },
668 { "Courier New", 0, "Bold", 'k' },
669 { "Courier New", 0, "Bold Italic", 'M' },
673 /* De-embolden these glyphs slightly. */
674 #define DEEMBOLDEN_RULES_SIZE 9
676 SPH_TweakRule DEEMBOLDEN_Rules
677 [DEEMBOLDEN_RULES_SIZE] =
679 { "Courier New", 0, "Bold", 'A' },
680 { "Courier New", 0, "Bold", 'W' },
681 { "Courier New", 0, "Bold", 'w' },
682 { "Courier New", 0, "Bold", 'M' },
683 { "Courier New", 0, "Bold", 'X' },
684 { "Courier New", 0, "Bold", 'K' },
685 { "Courier New", 0, "Bold", 'x' },
686 { "Courier New", 0, "Bold", 'z' },
687 { "Courier New", 0, "Bold", 'v' },
691 /* Embolden these glyphs slightly. */
692 #define EMBOLDEN_RULES_SIZE 5
694 SPH_TweakRule EMBOLDEN_Rules
695 [EMBOLDEN_RULES_SIZE] =
697 { "Courier New", 12, "Italic", 'z' },
698 { "Courier New", 11, "Italic", 'z' },
699 { "Courier New", 10, "Italic", 'z' },
700 { "Courier New", 0, "Regular", 0 },
701 { "Courier New", 0, "Italic", 0 },
705 /* Do an extra RDTG instruction in DELTAP if matched. */
706 #define DELTAP_RDTG_RULES_SIZE 1
708 SPH_TweakRule DELTAP_RDTG_Rules
709 [DELTAP_RDTG_RULES_SIZE] =
715 /* This is a CVT hack that makes thick horizontal stems on 2, 5, 7 */
716 /* similar to Windows XP. */
717 #define TIMES_NEW_ROMAN_HACK_RULES_SIZE 12
719 SPH_TweakRule TIMES_NEW_ROMAN_HACK_Rules
720 [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =
722 { "Times New Roman", 16, "Italic", '2' },
723 { "Times New Roman", 16, "Italic", '5' },
724 { "Times New Roman", 16, "Italic", '7' },
725 { "Times New Roman", 16, "Regular", '2' },
726 { "Times New Roman", 16, "Regular", '5' },
727 { "Times New Roman", 16, "Regular", '7' },
728 { "Times New Roman", 17, "Italic", '2' },
729 { "Times New Roman", 17, "Italic", '5' },
730 { "Times New Roman", 17, "Italic", '7' },
731 { "Times New Roman", 17, "Regular", '2' },
732 { "Times New Roman", 17, "Regular", '5' },
733 { "Times New Roman", 17, "Regular", '7' },
737 /* This fudges distance on 2 to get rid of the vanishing stem issue. */
738 /* A real solution to this is certainly welcome. */
739 #define COURIER_NEW_2_HACK_RULES_SIZE 15
741 SPH_TweakRule COURIER_NEW_2_HACK_Rules
742 [COURIER_NEW_2_HACK_RULES_SIZE] =
744 { "Courier New", 10, "Regular", '2' },
745 { "Courier New", 11, "Regular", '2' },
746 { "Courier New", 12, "Regular", '2' },
747 { "Courier New", 13, "Regular", '2' },
748 { "Courier New", 14, "Regular", '2' },
749 { "Courier New", 15, "Regular", '2' },
750 { "Courier New", 16, "Regular", '2' },
751 { "Courier New", 17, "Regular", '2' },
752 { "Courier New", 18, "Regular", '2' },
753 { "Courier New", 19, "Regular", '2' },
754 { "Courier New", 20, "Regular", '2' },
755 { "Courier New", 21, "Regular", '2' },
756 { "Courier New", 22, "Regular", '2' },
757 { "Courier New", 23, "Regular", '2' },
758 { "Courier New", 24, "Regular", '2' },
762 #ifndef FORCE_NATURAL_WIDTHS
764 /* Use compatible widths with these glyphs. Compatible widths is always */
765 /* on when doing B/W TrueType instructing, but is used selectively here, */
766 /* typically on glyphs with 3 or more vertical stems. */
767 #define COMPATIBLE_WIDTHS_RULES_SIZE 38
769 SPH_TweakRule COMPATIBLE_WIDTHS_Rules
770 [COMPATIBLE_WIDTHS_RULES_SIZE] =
772 { "Arial Unicode MS", 12, "Regular Class", 'm' },
773 { "Arial Unicode MS", 14, "Regular Class", 'm' },
774 /* Cyrillic small letter sha */
775 { "Arial", 10, "Regular Class", 0x448 },
776 { "Arial", 11, "Regular Class", 'm' },
777 { "Arial", 12, "Regular Class", 'm' },
778 /* Cyrillic small letter sha */
779 { "Arial", 12, "Regular Class", 0x448 },
780 { "Arial", 13, "Regular Class", 0x448 },
781 { "Arial", 14, "Regular Class", 'm' },
782 /* Cyrillic small letter sha */
783 { "Arial", 14, "Regular Class", 0x448 },
784 { "Arial", 15, "Regular Class", 0x448 },
785 { "Arial", 17, "Regular Class", 'm' },
786 { "DejaVu Sans", 15, "Regular Class", 0 },
787 { "Microsoft Sans Serif", 11, "Regular Class", 0 },
788 { "Microsoft Sans Serif", 12, "Regular Class", 0 },
789 { "Segoe UI", 11, "Regular Class", 0 },
790 { "Monaco", 0, "Regular Class", 0 },
791 { "Segoe UI", 12, "Regular Class", 'm' },
792 { "Segoe UI", 14, "Regular Class", 'm' },
793 { "Tahoma", 11, "Regular Class", 0 },
794 { "Times New Roman", 16, "Regular Class", 'c' },
795 { "Times New Roman", 16, "Regular Class", 'm' },
796 { "Times New Roman", 16, "Regular Class", 'o' },
797 { "Times New Roman", 16, "Regular Class", 'w' },
798 { "Trebuchet MS", 11, "Regular Class", 0 },
799 { "Trebuchet MS", 12, "Regular Class", 0 },
800 { "Trebuchet MS", 14, "Regular Class", 0 },
801 { "Trebuchet MS", 15, "Regular Class", 0 },
802 { "Ubuntu", 12, "Regular Class", 'm' },
803 /* Cyrillic small letter sha */
804 { "Verdana", 10, "Regular Class", 0x448 },
805 { "Verdana", 11, "Regular Class", 0x448 },
806 { "Verdana and Clones", 12, "Regular Class", 'i' },
807 { "Verdana and Clones", 12, "Regular Class", 'j' },
808 { "Verdana and Clones", 12, "Regular Class", 'l' },
809 { "Verdana and Clones", 12, "Regular Class", 'm' },
810 { "Verdana and Clones", 13, "Regular Class", 'i' },
811 { "Verdana and Clones", 13, "Regular Class", 'j' },
812 { "Verdana and Clones", 13, "Regular Class", 'l' },
813 { "Verdana and Clones", 14, "Regular Class", 'm' },
817 /* Scaling slightly in the x-direction prior to hinting results in */
818 /* more visually pleasing glyphs in certain cases. */
819 /* This sometimes needs to be coordinated with compatible width rules. */
820 /* A value of 1000 corresponds to a scaled value of 1.0. */
821 #define X_SCALING_RULES_SIZE 50
823 SPH_ScaleRule X_SCALING_Rules
824 [X_SCALING_RULES_SIZE] =
826 { "DejaVu Sans", 12, "Regular Class", 'm', 950 },
827 { "Verdana and Clones", 12, "Regular Class", 'a', 1100 },
828 { "Verdana and Clones", 13, "Regular Class", 'a', 1050 },
829 { "Arial", 11, "Regular Class", 'm', 975 },
830 { "Arial", 12, "Regular Class", 'm', 1050 },
831 /* Cyrillic small letter el */
832 { "Arial", 13, "Regular Class", 0x43B, 950 },
833 { "Arial", 13, "Regular Class", 'o', 950 },
834 { "Arial", 13, "Regular Class", 'e', 950 },
835 { "Arial", 14, "Regular Class", 'm', 950 },
836 /* Cyrillic small letter el */
837 { "Arial", 15, "Regular Class", 0x43B, 925 },
838 { "Bitstream Vera Sans", 10, "Regular/Italic Class", 0, 1100 },
839 { "Bitstream Vera Sans", 12, "Regular/Italic Class", 0, 1050 },
840 { "Bitstream Vera Sans", 16, "Regular Class", 0, 1050 },
841 { "Bitstream Vera Sans", 9, "Regular/Italic Class", 0, 1050 },
842 { "DejaVu Sans", 12, "Regular Class", 'l', 975 },
843 { "DejaVu Sans", 12, "Regular Class", 'i', 975 },
844 { "DejaVu Sans", 12, "Regular Class", 'j', 975 },
845 { "DejaVu Sans", 13, "Regular Class", 'l', 950 },
846 { "DejaVu Sans", 13, "Regular Class", 'i', 950 },
847 { "DejaVu Sans", 13, "Regular Class", 'j', 950 },
848 { "DejaVu Sans", 10, "Regular/Italic Class", 0, 1100 },
849 { "DejaVu Sans", 12, "Regular/Italic Class", 0, 1050 },
850 { "Georgia", 10, "", 0, 1050 },
851 { "Georgia", 11, "", 0, 1100 },
852 { "Georgia", 12, "", 0, 1025 },
853 { "Georgia", 13, "", 0, 1050 },
854 { "Georgia", 16, "", 0, 1050 },
855 { "Georgia", 17, "", 0, 1030 },
856 { "Liberation Sans", 12, "Regular Class", 'm', 1100 },
857 { "Lucida Grande", 11, "Regular Class", 'm', 1100 },
858 { "Microsoft Sans Serif", 11, "Regular Class", 'm', 950 },
859 { "Microsoft Sans Serif", 12, "Regular Class", 'm', 1050 },
860 { "Segoe UI", 12, "Regular Class", 'H', 1050 },
861 { "Segoe UI", 12, "Regular Class", 'm', 1050 },
862 { "Segoe UI", 14, "Regular Class", 'm', 1050 },
863 { "Tahoma", 11, "Regular Class", 'i', 975 },
864 { "Tahoma", 11, "Regular Class", 'l', 975 },
865 { "Tahoma", 11, "Regular Class", 'j', 900 },
866 { "Tahoma", 11, "Regular Class", 'm', 918 },
867 { "Verdana", 10, "Regular/Italic Class", 0, 1100 },
868 { "Verdana", 12, "Regular Class", 'm', 975 },
869 { "Verdana", 12, "Regular/Italic Class", 0, 1050 },
870 { "Verdana", 13, "Regular/Italic Class", 'i', 950 },
871 { "Verdana", 13, "Regular/Italic Class", 'j', 950 },
872 { "Verdana", 13, "Regular/Italic Class", 'l', 950 },
873 { "Verdana", 16, "Regular Class", 0, 1050 },
874 { "Verdana", 9, "Regular/Italic Class", 0, 1050 },
875 { "Times New Roman", 16, "Regular Class", 'm', 918 },
876 { "Trebuchet MS", 11, "Regular Class", 'm', 800 },
877 { "Trebuchet MS", 12, "Regular Class", 'm', 800 },
882 #define COMPATIBLE_WIDTHS_RULES_SIZE 1
884 SPH_TweakRule COMPATIBLE_WIDTHS_Rules
885 [COMPATIBLE_WIDTHS_RULES_SIZE] =
891 #define X_SCALING_RULES_SIZE 1
893 SPH_ScaleRule X_SCALING_Rules
894 [X_SCALING_RULES_SIZE] =
896 { "-", 0, "", 0, 1000 },
899 #endif /* FORCE_NATURAL_WIDTHS */
901 #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
906 #endif /* __TTSUBPIX_H__ */