Alexei Podtelezhnikov pushed to branch bytecode_tweaks at FreeType / FreeType
Commits:
-
c2789e75
by Werner Lemberg at 2025-05-08T07:03:31+02:00
-
04455084
by Werner Lemberg at 2025-05-08T07:49:10+02:00
-
9f587192
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
1fef1316
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
bc447b89
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
ef6c3022
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
50e14dcb
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
4ea5c623
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
-
dcc96f9b
by Alexei Podtelezhnikov (Алексей Подтележников) at 2025-05-08T20:00:56-04:00
8 changed files:
- docs/CHANGES
- include/freetype/freetype.h
- include/freetype/ftcolor.h
- include/freetype/ttnameid.h
- src/truetype/ttgload.c
- src/truetype/ttinterp.c
- src/truetype/ttinterp.h
- src/truetype/ttobjs.c
Changes:
... | ... | @@ -389,6 +389,10 @@ CHANGES BETWEEN 2.10.4 and 2.11.0 (2021-Jul-18) |
389 | 389 | corresponding `FT_COLR_Paint` object, which contains details
|
390 | 390 | on how to draw the respective 'COLR' v1 `Paint` table.
|
391 | 391 | |
392 | + Please note that FreeType does *not* provide rendering support for
|
|
393 | + 'COLR' v1 but only parsing of this table. You need a dedicated
|
|
394 | + graphics library like Skia or Cairo for rendering.
|
|
395 | + |
|
392 | 396 | |
393 | 397 | II. MISCELLANEOUS
|
394 | 398 |
... | ... | @@ -3441,8 +3441,10 @@ FT_BEGIN_HEADER |
3441 | 3441 | * blending of the color glyph layers associated with the glyph index,
|
3442 | 3442 | * using the same bitmap format as embedded color bitmap images. This
|
3443 | 3443 | * is mainly for convenience and works only for glyphs in 'COLR' v0
|
3444 | - * tables (or glyphs in 'COLR' v1 tables that exclusively use v0
|
|
3445 | - * features). For full control of color layers use
|
|
3444 | + * tables. **There is no rendering support for 'COLR' v1** (with the
|
|
3445 | + * exception of v1 tables that exclusively use v0 features)! You need
|
|
3446 | + * a graphics library like Skia or Cairo to interpret the graphics
|
|
3447 | + * commands stored in v1 tables. For full control of color layers use
|
|
3446 | 3448 | * @FT_Get_Color_Glyph_Layer and FreeType's color functions like
|
3447 | 3449 | * @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
|
3448 | 3450 | * so that the client application can handle blending by itself.
|
... | ... | @@ -317,6 +317,15 @@ FT_BEGIN_HEADER |
317 | 317 | * @description:
|
318 | 318 | * The functions described here allow access of colored glyph layer data
|
319 | 319 | * in OpenType's 'COLR' tables.
|
320 | + *
|
|
321 | + * Note that FreeType does *not* provide rendering in general of glyphs
|
|
322 | + * that use a 'COLR' table! While FreeType has very limited rendering
|
|
323 | + * support for 'COLR' v0 tables (without a possibility to change the
|
|
324 | + * color palette) via @FT_Render_Glyph, there is no such convenience
|
|
325 | + * code for 'COLR' v1 tables -- while it appears that v1 is simply an
|
|
326 | + * 'improved' version of v0, this is not the case: it is a completely
|
|
327 | + * different color font format, and you need a dedicated graphics
|
|
328 | + * library like Skia or Cairo to handle a v1 table's drawing commands.
|
|
320 | 329 | */
|
321 | 330 | |
322 | 331 |
... | ... | @@ -847,113 +847,113 @@ FT_BEGIN_HEADER |
847 | 847 | /* --------------- */
|
848 | 848 | |
849 | 849 | /* Bit 0 Basic Latin */
|
850 | -#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
|
|
850 | +#define TT_UCR_BASIC_LATIN (1UL << 0) /* U+0020-U+007E */
|
|
851 | 851 | /* Bit 1 C1 Controls and Latin-1 Supplement */
|
852 | -#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
|
|
852 | +#define TT_UCR_LATIN1_SUPPLEMENT (1UL << 1) /* U+0080-U+00FF */
|
|
853 | 853 | /* Bit 2 Latin Extended-A */
|
854 | -#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
|
|
854 | +#define TT_UCR_LATIN_EXTENDED_A (1UL << 2) /* U+0100-U+017F */
|
|
855 | 855 | /* Bit 3 Latin Extended-B */
|
856 | -#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
|
|
856 | +#define TT_UCR_LATIN_EXTENDED_B (1UL << 3) /* U+0180-U+024F */
|
|
857 | 857 | /* Bit 4 IPA Extensions */
|
858 | 858 | /* Phonetic Extensions */
|
859 | 859 | /* Phonetic Extensions Supplement */
|
860 | -#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
|
|
860 | +#define TT_UCR_IPA_EXTENSIONS (1UL << 4) /* U+0250-U+02AF */
|
|
861 | 861 | /* U+1D00-U+1D7F */
|
862 | 862 | /* U+1D80-U+1DBF */
|
863 | 863 | /* Bit 5 Spacing Modifier Letters */
|
864 | 864 | /* Modifier Tone Letters */
|
865 | -#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
|
|
865 | +#define TT_UCR_SPACING_MODIFIER (1UL << 5) /* U+02B0-U+02FF */
|
|
866 | 866 | /* U+A700-U+A71F */
|
867 | 867 | /* Bit 6 Combining Diacritical Marks */
|
868 | 868 | /* Combining Diacritical Marks Supplement */
|
869 | -#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */
|
|
869 | +#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1UL << 6) /* U+0300-U+036F */
|
|
870 | 870 | /* U+1DC0-U+1DFF */
|
871 | 871 | /* Bit 7 Greek and Coptic */
|
872 | -#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
|
|
872 | +#define TT_UCR_GREEK (1UL << 7) /* U+0370-U+03FF */
|
|
873 | 873 | /* Bit 8 Coptic */
|
874 | -#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
|
|
874 | +#define TT_UCR_COPTIC (1UL << 8) /* U+2C80-U+2CFF */
|
|
875 | 875 | /* Bit 9 Cyrillic */
|
876 | 876 | /* Cyrillic Supplement */
|
877 | 877 | /* Cyrillic Extended-A */
|
878 | 878 | /* Cyrillic Extended-B */
|
879 | -#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
|
|
879 | +#define TT_UCR_CYRILLIC (1UL << 9) /* U+0400-U+04FF */
|
|
880 | 880 | /* U+0500-U+052F */
|
881 | 881 | /* U+2DE0-U+2DFF */
|
882 | 882 | /* U+A640-U+A69F */
|
883 | 883 | /* Bit 10 Armenian */
|
884 | -#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
|
|
884 | +#define TT_UCR_ARMENIAN (1UL << 10) /* U+0530-U+058F */
|
|
885 | 885 | /* Bit 11 Hebrew */
|
886 | -#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
|
|
886 | +#define TT_UCR_HEBREW (1UL << 11) /* U+0590-U+05FF */
|
|
887 | 887 | /* Bit 12 Vai */
|
888 | -#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
|
|
888 | +#define TT_UCR_VAI (1UL << 12) /* U+A500-U+A63F */
|
|
889 | 889 | /* Bit 13 Arabic */
|
890 | 890 | /* Arabic Supplement */
|
891 | -#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
|
|
891 | +#define TT_UCR_ARABIC (1UL << 13) /* U+0600-U+06FF */
|
|
892 | 892 | /* U+0750-U+077F */
|
893 | 893 | /* Bit 14 NKo */
|
894 | -#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
|
|
894 | +#define TT_UCR_NKO (1UL << 14) /* U+07C0-U+07FF */
|
|
895 | 895 | /* Bit 15 Devanagari */
|
896 | -#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
|
|
897 | - /* Bit 16 Bengali */
|
|
898 | -#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
|
|
896 | +#define TT_UCR_DEVANAGARI (1UL << 15) /* U+0900-U+097F */
|
|
897 | + /* Bit 16 Bangla (Bengali) */
|
|
898 | +#define TT_UCR_BENGALI (1UL << 16) /* U+0980-U+09FF */
|
|
899 | 899 | /* Bit 17 Gurmukhi */
|
900 | -#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
|
|
900 | +#define TT_UCR_GURMUKHI (1UL << 17) /* U+0A00-U+0A7F */
|
|
901 | 901 | /* Bit 18 Gujarati */
|
902 | -#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
|
|
903 | - /* Bit 19 Oriya */
|
|
904 | -#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
|
|
902 | +#define TT_UCR_GUJARATI (1UL << 18) /* U+0A80-U+0AFF */
|
|
903 | + /* Bit 19 Oriya (Odia) */
|
|
904 | +#define TT_UCR_ORIYA (1UL << 19) /* U+0B00-U+0B7F */
|
|
905 | 905 | /* Bit 20 Tamil */
|
906 | -#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
|
|
906 | +#define TT_UCR_TAMIL (1UL << 20) /* U+0B80-U+0BFF */
|
|
907 | 907 | /* Bit 21 Telugu */
|
908 | -#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
|
|
908 | +#define TT_UCR_TELUGU (1UL << 21) /* U+0C00-U+0C7F */
|
|
909 | 909 | /* Bit 22 Kannada */
|
910 | -#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
|
|
910 | +#define TT_UCR_KANNADA (1UL << 22) /* U+0C80-U+0CFF */
|
|
911 | 911 | /* Bit 23 Malayalam */
|
912 | -#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
|
|
912 | +#define TT_UCR_MALAYALAM (1UL << 23) /* U+0D00-U+0D7F */
|
|
913 | 913 | /* Bit 24 Thai */
|
914 | -#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
|
|
914 | +#define TT_UCR_THAI (1UL << 24) /* U+0E00-U+0E7F */
|
|
915 | 915 | /* Bit 25 Lao */
|
916 | -#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
|
|
916 | +#define TT_UCR_LAO (1UL << 25) /* U+0E80-U+0EFF */
|
|
917 | 917 | /* Bit 26 Georgian */
|
918 | 918 | /* Georgian Supplement */
|
919 | -#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
|
|
919 | +#define TT_UCR_GEORGIAN (1UL << 26) /* U+10A0-U+10FF */
|
|
920 | 920 | /* U+2D00-U+2D2F */
|
921 | 921 | /* Bit 27 Balinese */
|
922 | -#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
|
|
922 | +#define TT_UCR_BALINESE (1UL << 27) /* U+1B00-U+1B7F */
|
|
923 | 923 | /* Bit 28 Hangul Jamo */
|
924 | -#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
|
|
924 | +#define TT_UCR_HANGUL_JAMO (1UL << 28) /* U+1100-U+11FF */
|
|
925 | 925 | /* Bit 29 Latin Extended Additional */
|
926 | 926 | /* Latin Extended-C */
|
927 | 927 | /* Latin Extended-D */
|
928 | -#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
|
|
928 | +#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1UL << 29) /* U+1E00-U+1EFF */
|
|
929 | 929 | /* U+2C60-U+2C7F */
|
930 | 930 | /* U+A720-U+A7FF */
|
931 | 931 | /* Bit 30 Greek Extended */
|
932 | -#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
|
|
932 | +#define TT_UCR_GREEK_EXTENDED (1UL << 30) /* U+1F00-U+1FFF */
|
|
933 | 933 | /* Bit 31 General Punctuation */
|
934 | 934 | /* Supplemental Punctuation */
|
935 | -#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
|
|
935 | +#define TT_UCR_GENERAL_PUNCTUATION (1UL << 31) /* U+2000-U+206F */
|
|
936 | 936 | /* U+2E00-U+2E7F */
|
937 | 937 | |
938 | 938 | /* ulUnicodeRange2 */
|
939 | 939 | /* --------------- */
|
940 | 940 | |
941 | 941 | /* Bit 32 Superscripts And Subscripts */
|
942 | -#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
|
|
942 | +#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1UL << 0) /* U+2070-U+209F */
|
|
943 | 943 | /* Bit 33 Currency Symbols */
|
944 | -#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
|
|
944 | +#define TT_UCR_CURRENCY_SYMBOLS (1UL << 1) /* U+20A0-U+20CF */
|
|
945 | 945 | /* Bit 34 Combining Diacritical Marks For Symbols */
|
946 | 946 | #define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
|
947 | - (1L << 2) /* U+20D0-U+20FF */
|
|
947 | + (1UL << 2) /* U+20D0-U+20FF */
|
|
948 | 948 | /* Bit 35 Letterlike Symbols */
|
949 | -#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
|
|
949 | +#define TT_UCR_LETTERLIKE_SYMBOLS (1UL << 3) /* U+2100-U+214F */
|
|
950 | 950 | /* Bit 36 Number Forms */
|
951 | -#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
|
|
951 | +#define TT_UCR_NUMBER_FORMS (1UL << 4) /* U+2150-U+218F */
|
|
952 | 952 | /* Bit 37 Arrows */
|
953 | 953 | /* Supplemental Arrows-A */
|
954 | 954 | /* Supplemental Arrows-B */
|
955 | 955 | /* Miscellaneous Symbols and Arrows */
|
956 | -#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
|
|
956 | +#define TT_UCR_ARROWS (1UL << 5) /* U+2190-U+21FF */
|
|
957 | 957 | /* U+27F0-U+27FF */
|
958 | 958 | /* U+2900-U+297F */
|
959 | 959 | /* U+2B00-U+2BFF */
|
... | ... | @@ -961,52 +961,52 @@ FT_BEGIN_HEADER |
961 | 961 | /* Supplemental Mathematical Operators */
|
962 | 962 | /* Miscellaneous Mathematical Symbols-A */
|
963 | 963 | /* Miscellaneous Mathematical Symbols-B */
|
964 | -#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
|
|
964 | +#define TT_UCR_MATHEMATICAL_OPERATORS (1UL << 6) /* U+2200-U+22FF */
|
|
965 | 965 | /* U+2A00-U+2AFF */
|
966 | 966 | /* U+27C0-U+27EF */
|
967 | 967 | /* U+2980-U+29FF */
|
968 | 968 | /* Bit 39 Miscellaneous Technical */
|
969 | -#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
|
|
969 | +#define TT_UCR_MISCELLANEOUS_TECHNICAL (1UL << 7) /* U+2300-U+23FF */
|
|
970 | 970 | /* Bit 40 Control Pictures */
|
971 | -#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
|
|
971 | +#define TT_UCR_CONTROL_PICTURES (1UL << 8) /* U+2400-U+243F */
|
|
972 | 972 | /* Bit 41 Optical Character Recognition */
|
973 | -#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
|
|
973 | +#define TT_UCR_OCR (1UL << 9) /* U+2440-U+245F */
|
|
974 | 974 | /* Bit 42 Enclosed Alphanumerics */
|
975 | -#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
|
|
975 | +#define TT_UCR_ENCLOSED_ALPHANUMERICS (1UL << 10) /* U+2460-U+24FF */
|
|
976 | 976 | /* Bit 43 Box Drawing */
|
977 | -#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
|
|
977 | +#define TT_UCR_BOX_DRAWING (1UL << 11) /* U+2500-U+257F */
|
|
978 | 978 | /* Bit 44 Block Elements */
|
979 | -#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
|
|
979 | +#define TT_UCR_BLOCK_ELEMENTS (1UL << 12) /* U+2580-U+259F */
|
|
980 | 980 | /* Bit 45 Geometric Shapes */
|
981 | -#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
|
|
981 | +#define TT_UCR_GEOMETRIC_SHAPES (1UL << 13) /* U+25A0-U+25FF */
|
|
982 | 982 | /* Bit 46 Miscellaneous Symbols */
|
983 | -#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
|
|
983 | +#define TT_UCR_MISCELLANEOUS_SYMBOLS (1UL << 14) /* U+2600-U+26FF */
|
|
984 | 984 | /* Bit 47 Dingbats */
|
985 | -#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
|
|
985 | +#define TT_UCR_DINGBATS (1UL << 15) /* U+2700-U+27BF */
|
|
986 | 986 | /* Bit 48 CJK Symbols and Punctuation */
|
987 | -#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
|
|
987 | +#define TT_UCR_CJK_SYMBOLS (1UL << 16) /* U+3000-U+303F */
|
|
988 | 988 | /* Bit 49 Hiragana */
|
989 | -#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
|
|
989 | +#define TT_UCR_HIRAGANA (1UL << 17) /* U+3040-U+309F */
|
|
990 | 990 | /* Bit 50 Katakana */
|
991 | 991 | /* Katakana Phonetic Extensions */
|
992 | -#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
|
|
992 | +#define TT_UCR_KATAKANA (1UL << 18) /* U+30A0-U+30FF */
|
|
993 | 993 | /* U+31F0-U+31FF */
|
994 | 994 | /* Bit 51 Bopomofo */
|
995 | 995 | /* Bopomofo Extended */
|
996 | -#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
|
|
996 | +#define TT_UCR_BOPOMOFO (1UL << 19) /* U+3100-U+312F */
|
|
997 | 997 | /* U+31A0-U+31BF */
|
998 | 998 | /* Bit 52 Hangul Compatibility Jamo */
|
999 | -#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
|
|
999 | +#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1UL << 20) /* U+3130-U+318F */
|
|
1000 | 1000 | /* Bit 53 Phags-Pa */
|
1001 | -#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
|
|
1002 | -#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
|
|
1003 | -#define TT_UCR_PHAGSPA
|
|
1001 | +#define TT_UCR_PHAGSPA (1UL << 21) /* U+A840-U+A87F */
|
|
1002 | +#define TT_UCR_KANBUN TT_UCR_PHAGSPA /* deprecated */
|
|
1003 | +#define TT_UCR_CJK_MISC TT_UCR_PHAGSPA /* deprecated */
|
|
1004 | 1004 | /* Bit 54 Enclosed CJK Letters and Months */
|
1005 | -#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
|
|
1005 | +#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1UL << 22) /* U+3200-U+32FF */
|
|
1006 | 1006 | /* Bit 55 CJK Compatibility */
|
1007 | -#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
|
|
1007 | +#define TT_UCR_CJK_COMPATIBILITY (1UL << 23) /* U+3300-U+33FF */
|
|
1008 | 1008 | /* Bit 56 Hangul Syllables */
|
1009 | -#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
|
|
1009 | +#define TT_UCR_HANGUL (1UL << 24) /* U+AC00-U+D7A3 */
|
|
1010 | 1010 | /* Bit 57 High Surrogates */
|
1011 | 1011 | /* High Private Use Surrogates */
|
1012 | 1012 | /* Low Surrogates */
|
... | ... | @@ -1017,12 +1017,12 @@ FT_BEGIN_HEADER |
1017 | 1017 | /* Basic Multilingual Plane that is */
|
1018 | 1018 | /* supported by this font. So it really */
|
1019 | 1019 | /* means >= U+10000. */
|
1020 | -#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
|
|
1020 | +#define TT_UCR_SURROGATES (1UL << 25) /* U+D800-U+DB7F */
|
|
1021 | 1021 | /* U+DB80-U+DBFF */
|
1022 | 1022 | /* U+DC00-U+DFFF */
|
1023 | 1023 | #define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
|
1024 | 1024 | /* Bit 58 Phoenician */
|
1025 | -#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
|
|
1025 | +#define TT_UCR_PHOENICIAN (1UL << 26) /*U+10900-U+1091F*/
|
|
1026 | 1026 | /* Bit 59 CJK Unified Ideographs */
|
1027 | 1027 | /* CJK Radicals Supplement */
|
1028 | 1028 | /* Kangxi Radicals */
|
... | ... | @@ -1030,7 +1030,7 @@ FT_BEGIN_HEADER |
1030 | 1030 | /* CJK Unified Ideographs Extension A */
|
1031 | 1031 | /* CJK Unified Ideographs Extension B */
|
1032 | 1032 | /* Kanbun */
|
1033 | -#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
|
|
1033 | +#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1UL << 27) /* U+4E00-U+9FFF */
|
|
1034 | 1034 | /* U+2E80-U+2EFF */
|
1035 | 1035 | /* U+2F00-U+2FDF */
|
1036 | 1036 | /* U+2FF0-U+2FFF */
|
... | ... | @@ -1038,178 +1038,178 @@ FT_BEGIN_HEADER |
1038 | 1038 | /*U+20000-U+2A6DF*/
|
1039 | 1039 | /* U+3190-U+319F */
|
1040 | 1040 | /* Bit 60 Private Use */
|
1041 | -#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
|
|
1041 | +#define TT_UCR_PRIVATE_USE (1UL << 28) /* U+E000-U+F8FF */
|
|
1042 | 1042 | /* Bit 61 CJK Strokes */
|
1043 | 1043 | /* CJK Compatibility Ideographs */
|
1044 | 1044 | /* CJK Compatibility Ideographs Supplement */
|
1045 | -#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
|
|
1045 | +#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1UL << 29) /* U+31C0-U+31EF */
|
|
1046 | 1046 | /* U+F900-U+FAFF */
|
1047 | 1047 | /*U+2F800-U+2FA1F*/
|
1048 | 1048 | /* Bit 62 Alphabetic Presentation Forms */
|
1049 | -#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
|
|
1049 | +#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1UL << 30) /* U+FB00-U+FB4F */
|
|
1050 | 1050 | /* Bit 63 Arabic Presentation Forms-A */
|
1051 | -#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */
|
|
1051 | +#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1UL << 31) /* U+FB50-U+FDFF */
|
|
1052 | 1052 | |
1053 | 1053 | /* ulUnicodeRange3 */
|
1054 | 1054 | /* --------------- */
|
1055 | 1055 | |
1056 | 1056 | /* Bit 64 Combining Half Marks */
|
1057 | -#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
|
|
1057 | +#define TT_UCR_COMBINING_HALF_MARKS (1UL << 0) /* U+FE20-U+FE2F */
|
|
1058 | 1058 | /* Bit 65 Vertical forms */
|
1059 | 1059 | /* CJK Compatibility Forms */
|
1060 | -#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
|
|
1060 | +#define TT_UCR_CJK_COMPATIBILITY_FORMS (1UL << 1) /* U+FE10-U+FE1F */
|
|
1061 | 1061 | /* U+FE30-U+FE4F */
|
1062 | 1062 | /* Bit 66 Small Form Variants */
|
1063 | -#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
|
|
1063 | +#define TT_UCR_SMALL_FORM_VARIANTS (1UL << 2) /* U+FE50-U+FE6F */
|
|
1064 | 1064 | /* Bit 67 Arabic Presentation Forms-B */
|
1065 | -#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */
|
|
1065 | +#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1UL << 3) /* U+FE70-U+FEFF */
|
|
1066 | 1066 | /* Bit 68 Halfwidth and Fullwidth Forms */
|
1067 | -#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
|
|
1067 | +#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1UL << 4) /* U+FF00-U+FFEF */
|
|
1068 | 1068 | /* Bit 69 Specials */
|
1069 | -#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
|
|
1069 | +#define TT_UCR_SPECIALS (1UL << 5) /* U+FFF0-U+FFFF */
|
|
1070 | 1070 | /* Bit 70 Tibetan */
|
1071 | -#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
|
|
1071 | +#define TT_UCR_TIBETAN (1UL << 6) /* U+0F00-U+0FFF */
|
|
1072 | 1072 | /* Bit 71 Syriac */
|
1073 | -#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
|
|
1073 | +#define TT_UCR_SYRIAC (1UL << 7) /* U+0700-U+074F */
|
|
1074 | 1074 | /* Bit 72 Thaana */
|
1075 | -#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
|
|
1075 | +#define TT_UCR_THAANA (1UL << 8) /* U+0780-U+07BF */
|
|
1076 | 1076 | /* Bit 73 Sinhala */
|
1077 | -#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
|
|
1077 | +#define TT_UCR_SINHALA (1UL << 9) /* U+0D80-U+0DFF */
|
|
1078 | 1078 | /* Bit 74 Myanmar */
|
1079 | -#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
|
|
1079 | +#define TT_UCR_MYANMAR (1UL << 10) /* U+1000-U+109F */
|
|
1080 | 1080 | /* Bit 75 Ethiopic */
|
1081 | 1081 | /* Ethiopic Supplement */
|
1082 | 1082 | /* Ethiopic Extended */
|
1083 | -#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
|
|
1083 | +#define TT_UCR_ETHIOPIC (1UL << 11) /* U+1200-U+137F */
|
|
1084 | 1084 | /* U+1380-U+139F */
|
1085 | 1085 | /* U+2D80-U+2DDF */
|
1086 | 1086 | /* Bit 76 Cherokee */
|
1087 | -#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
|
|
1087 | +#define TT_UCR_CHEROKEE (1UL << 12) /* U+13A0-U+13FF */
|
|
1088 | 1088 | /* Bit 77 Unified Canadian Aboriginal Syllabics */
|
1089 | -#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
|
|
1089 | +#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1UL << 13) /* U+1400-U+167F */
|
|
1090 | 1090 | /* Bit 78 Ogham */
|
1091 | -#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
|
|
1091 | +#define TT_UCR_OGHAM (1UL << 14) /* U+1680-U+169F */
|
|
1092 | 1092 | /* Bit 79 Runic */
|
1093 | -#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
|
|
1093 | +#define TT_UCR_RUNIC (1UL << 15) /* U+16A0-U+16FF */
|
|
1094 | 1094 | /* Bit 80 Khmer */
|
1095 | 1095 | /* Khmer Symbols */
|
1096 | -#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
|
|
1096 | +#define TT_UCR_KHMER (1UL << 16) /* U+1780-U+17FF */
|
|
1097 | 1097 | /* U+19E0-U+19FF */
|
1098 | 1098 | /* Bit 81 Mongolian */
|
1099 | -#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
|
|
1099 | +#define TT_UCR_MONGOLIAN (1UL << 17) /* U+1800-U+18AF */
|
|
1100 | 1100 | /* Bit 82 Braille Patterns */
|
1101 | -#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
|
|
1101 | +#define TT_UCR_BRAILLE (1UL << 18) /* U+2800-U+28FF */
|
|
1102 | 1102 | /* Bit 83 Yi Syllables */
|
1103 | 1103 | /* Yi Radicals */
|
1104 | -#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
|
|
1104 | +#define TT_UCR_YI (1UL << 19) /* U+A000-U+A48F */
|
|
1105 | 1105 | /* U+A490-U+A4CF */
|
1106 | 1106 | /* Bit 84 Tagalog */
|
1107 | 1107 | /* Hanunoo */
|
1108 | 1108 | /* Buhid */
|
1109 | 1109 | /* Tagbanwa */
|
1110 | -#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
|
|
1110 | +#define TT_UCR_PHILIPPINE (1UL << 20) /* U+1700-U+171F */
|
|
1111 | 1111 | /* U+1720-U+173F */
|
1112 | 1112 | /* U+1740-U+175F */
|
1113 | 1113 | /* U+1760-U+177F */
|
1114 | 1114 | /* Bit 85 Old Italic */
|
1115 | -#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
|
|
1115 | +#define TT_UCR_OLD_ITALIC (1UL << 21) /*U+10300-U+1032F*/
|
|
1116 | 1116 | /* Bit 86 Gothic */
|
1117 | -#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
|
|
1117 | +#define TT_UCR_GOTHIC (1UL << 22) /*U+10330-U+1034F*/
|
|
1118 | 1118 | /* Bit 87 Deseret */
|
1119 | -#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
|
|
1119 | +#define TT_UCR_DESERET (1UL << 23) /*U+10400-U+1044F*/
|
|
1120 | 1120 | /* Bit 88 Byzantine Musical Symbols */
|
1121 | 1121 | /* Musical Symbols */
|
1122 | 1122 | /* Ancient Greek Musical Notation */
|
1123 | -#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
|
|
1123 | +#define TT_UCR_MUSICAL_SYMBOLS (1UL << 24) /*U+1D000-U+1D0FF*/
|
|
1124 | 1124 | /*U+1D100-U+1D1FF*/
|
1125 | 1125 | /*U+1D200-U+1D24F*/
|
1126 | 1126 | /* Bit 89 Mathematical Alphanumeric Symbols */
|
1127 | -#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
|
|
1127 | +#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1UL << 25) /*U+1D400-U+1D7FF*/
|
|
1128 | 1128 | /* Bit 90 Private Use (plane 15) */
|
1129 | 1129 | /* Private Use (plane 16) */
|
1130 | -#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
|
|
1130 | +#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1UL << 26) /*U+F0000-U+FFFFD*/
|
|
1131 | 1131 | /*U+100000-U+10FFFD*/
|
1132 | 1132 | /* Bit 91 Variation Selectors */
|
1133 | 1133 | /* Variation Selectors Supplement */
|
1134 | -#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
|
|
1134 | +#define TT_UCR_VARIATION_SELECTORS (1UL << 27) /* U+FE00-U+FE0F */
|
|
1135 | 1135 | /*U+E0100-U+E01EF*/
|
1136 | 1136 | /* Bit 92 Tags */
|
1137 | -#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
|
|
1137 | +#define TT_UCR_TAGS (1UL << 28) /*U+E0000-U+E007F*/
|
|
1138 | 1138 | /* Bit 93 Limbu */
|
1139 | -#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
|
|
1139 | +#define TT_UCR_LIMBU (1UL << 29) /* U+1900-U+194F */
|
|
1140 | 1140 | /* Bit 94 Tai Le */
|
1141 | -#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
|
|
1141 | +#define TT_UCR_TAI_LE (1UL << 30) /* U+1950-U+197F */
|
|
1142 | 1142 | /* Bit 95 New Tai Lue */
|
1143 | -#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
|
|
1143 | +#define TT_UCR_NEW_TAI_LUE (1UL << 31) /* U+1980-U+19DF */
|
|
1144 | 1144 | |
1145 | 1145 | /* ulUnicodeRange4 */
|
1146 | 1146 | /* --------------- */
|
1147 | 1147 | |
1148 | 1148 | /* Bit 96 Buginese */
|
1149 | -#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
|
|
1149 | +#define TT_UCR_BUGINESE (1UL << 0) /* U+1A00-U+1A1F */
|
|
1150 | 1150 | /* Bit 97 Glagolitic */
|
1151 | -#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
|
|
1151 | +#define TT_UCR_GLAGOLITIC (1UL << 1) /* U+2C00-U+2C5F */
|
|
1152 | 1152 | /* Bit 98 Tifinagh */
|
1153 | -#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
|
|
1153 | +#define TT_UCR_TIFINAGH (1UL << 2) /* U+2D30-U+2D7F */
|
|
1154 | 1154 | /* Bit 99 Yijing Hexagram Symbols */
|
1155 | -#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
|
|
1155 | +#define TT_UCR_YIJING (1UL << 3) /* U+4DC0-U+4DFF */
|
|
1156 | 1156 | /* Bit 100 Syloti Nagri */
|
1157 | -#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
|
|
1157 | +#define TT_UCR_SYLOTI_NAGRI (1UL << 4) /* U+A800-U+A82F */
|
|
1158 | 1158 | /* Bit 101 Linear B Syllabary */
|
1159 | 1159 | /* Linear B Ideograms */
|
1160 | 1160 | /* Aegean Numbers */
|
1161 | -#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
|
|
1161 | +#define TT_UCR_LINEAR_B (1UL << 5) /*U+10000-U+1007F*/
|
|
1162 | 1162 | /*U+10080-U+100FF*/
|
1163 | 1163 | /*U+10100-U+1013F*/
|
1164 | 1164 | /* Bit 102 Ancient Greek Numbers */
|
1165 | -#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
|
|
1165 | +#define TT_UCR_ANCIENT_GREEK_NUMBERS (1UL << 6) /*U+10140-U+1018F*/
|
|
1166 | 1166 | /* Bit 103 Ugaritic */
|
1167 | -#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
|
|
1167 | +#define TT_UCR_UGARITIC (1UL << 7) /*U+10380-U+1039F*/
|
|
1168 | 1168 | /* Bit 104 Old Persian */
|
1169 | -#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
|
|
1169 | +#define TT_UCR_OLD_PERSIAN (1UL << 8) /*U+103A0-U+103DF*/
|
|
1170 | 1170 | /* Bit 105 Shavian */
|
1171 | -#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
|
|
1171 | +#define TT_UCR_SHAVIAN (1UL << 9) /*U+10450-U+1047F*/
|
|
1172 | 1172 | /* Bit 106 Osmanya */
|
1173 | -#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
|
|
1173 | +#define TT_UCR_OSMANYA (1UL << 10) /*U+10480-U+104AF*/
|
|
1174 | 1174 | /* Bit 107 Cypriot Syllabary */
|
1175 | -#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
|
|
1175 | +#define TT_UCR_CYPRIOT_SYLLABARY (1UL << 11) /*U+10800-U+1083F*/
|
|
1176 | 1176 | /* Bit 108 Kharoshthi */
|
1177 | -#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
|
|
1177 | +#define TT_UCR_KHAROSHTHI (1UL << 12) /*U+10A00-U+10A5F*/
|
|
1178 | 1178 | /* Bit 109 Tai Xuan Jing Symbols */
|
1179 | -#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
|
|
1179 | +#define TT_UCR_TAI_XUAN_JING (1UL << 13) /*U+1D300-U+1D35F*/
|
|
1180 | 1180 | /* Bit 110 Cuneiform */
|
1181 | 1181 | /* Cuneiform Numbers and Punctuation */
|
1182 | -#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
|
|
1182 | +#define TT_UCR_CUNEIFORM (1UL << 14) /*U+12000-U+123FF*/
|
|
1183 | 1183 | /*U+12400-U+1247F*/
|
1184 | 1184 | /* Bit 111 Counting Rod Numerals */
|
1185 | -#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
|
|
1185 | +#define TT_UCR_COUNTING_ROD_NUMERALS (1UL << 15) /*U+1D360-U+1D37F*/
|
|
1186 | 1186 | /* Bit 112 Sundanese */
|
1187 | -#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
|
|
1187 | +#define TT_UCR_SUNDANESE (1UL << 16) /* U+1B80-U+1BBF */
|
|
1188 | 1188 | /* Bit 113 Lepcha */
|
1189 | -#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
|
|
1189 | +#define TT_UCR_LEPCHA (1UL << 17) /* U+1C00-U+1C4F */
|
|
1190 | 1190 | /* Bit 114 Ol Chiki */
|
1191 | -#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
|
|
1191 | +#define TT_UCR_OL_CHIKI (1UL << 18) /* U+1C50-U+1C7F */
|
|
1192 | 1192 | /* Bit 115 Saurashtra */
|
1193 | -#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
|
|
1193 | +#define TT_UCR_SAURASHTRA (1UL << 19) /* U+A880-U+A8DF */
|
|
1194 | 1194 | /* Bit 116 Kayah Li */
|
1195 | -#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
|
|
1195 | +#define TT_UCR_KAYAH_LI (1UL << 20) /* U+A900-U+A92F */
|
|
1196 | 1196 | /* Bit 117 Rejang */
|
1197 | -#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
|
|
1197 | +#define TT_UCR_REJANG (1UL << 21) /* U+A930-U+A95F */
|
|
1198 | 1198 | /* Bit 118 Cham */
|
1199 | -#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
|
|
1199 | +#define TT_UCR_CHAM (1UL << 22) /* U+AA00-U+AA5F */
|
|
1200 | 1200 | /* Bit 119 Ancient Symbols */
|
1201 | -#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
|
|
1201 | +#define TT_UCR_ANCIENT_SYMBOLS (1UL << 23) /*U+10190-U+101CF*/
|
|
1202 | 1202 | /* Bit 120 Phaistos Disc */
|
1203 | -#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
|
|
1203 | +#define TT_UCR_PHAISTOS_DISC (1UL << 24) /*U+101D0-U+101FF*/
|
|
1204 | 1204 | /* Bit 121 Carian */
|
1205 | 1205 | /* Lycian */
|
1206 | 1206 | /* Lydian */
|
1207 | -#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
|
|
1207 | +#define TT_UCR_OLD_ANATOLIAN (1UL << 25) /*U+102A0-U+102DF*/
|
|
1208 | 1208 | /*U+10280-U+1029F*/
|
1209 | 1209 | /*U+10920-U+1093F*/
|
1210 | 1210 | /* Bit 122 Domino Tiles */
|
1211 | 1211 | /* Mahjong Tiles */
|
1212 | -#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
|
|
1212 | +#define TT_UCR_GAME_TILES (1UL << 26) /*U+1F030-U+1F09F*/
|
|
1213 | 1213 | /*U+1F000-U+1F02F*/
|
1214 | 1214 | /* Bit 123-127 Reserved for process-internal usage */
|
1215 | 1215 |
... | ... | @@ -2332,6 +2332,8 @@ |
2332 | 2332 | return error;
|
2333 | 2333 | }
|
2334 | 2334 | |
2335 | + exec->pedantic_hinting = pedantic;
|
|
2336 | + |
|
2335 | 2337 | /* check whether the cvt program has disabled hinting */
|
2336 | 2338 | if ( exec->GS.instruct_control & 1 )
|
2337 | 2339 | load_flags |= FT_LOAD_NO_HINTING;
|
... | ... | @@ -2362,7 +2364,6 @@ |
2362 | 2364 | exec->backward_compatibility = FALSE;
|
2363 | 2365 | #endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
|
2364 | 2366 | |
2365 | - exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
|
|
2366 | 2367 | loader->exec = exec;
|
2367 | 2368 | loader->instructions = exec->glyphIns;
|
2368 | 2369 |
... | ... | @@ -365,6 +365,9 @@ |
365 | 365 | exec->zp2 = exec->pts;
|
366 | 366 | exec->zp0 = exec->pts;
|
367 | 367 | |
368 | + exec->callTop = 0;
|
|
369 | + exec->top = 0;
|
|
370 | + |
|
368 | 371 | exec->instruction_trap = FALSE;
|
369 | 372 | |
370 | 373 | return FT_Err_Ok;
|
... | ... | @@ -1519,31 +1522,6 @@ |
1519 | 1522 | }
|
1520 | 1523 | |
1521 | 1524 | |
1522 | - /**************************************************************************
|
|
1523 | - *
|
|
1524 | - * @Function:
|
|
1525 | - * GetShortIns
|
|
1526 | - *
|
|
1527 | - * @Description:
|
|
1528 | - * Returns a short integer taken from the instruction stream at
|
|
1529 | - * address IP.
|
|
1530 | - *
|
|
1531 | - * @Return:
|
|
1532 | - * Short read at code[IP].
|
|
1533 | - *
|
|
1534 | - * @Note:
|
|
1535 | - * This one could become a macro.
|
|
1536 | - */
|
|
1537 | - static FT_Short
|
|
1538 | - GetShortIns( TT_ExecContext exc )
|
|
1539 | - {
|
|
1540 | - /* Reading a byte stream so there is no endianness (DaveP) */
|
|
1541 | - exc->IP += 2;
|
|
1542 | - return (FT_Short)( ( exc->code[exc->IP - 2] << 8 ) +
|
|
1543 | - exc->code[exc->IP - 1] );
|
|
1544 | - }
|
|
1545 | - |
|
1546 | - |
|
1547 | 1525 | /**************************************************************************
|
1548 | 1526 | *
|
1549 | 1527 | * @Function:
|
... | ... | @@ -1597,6 +1575,7 @@ |
1597 | 1575 | exc->code = range->base;
|
1598 | 1576 | exc->codeSize = range->size;
|
1599 | 1577 | exc->IP = aIP;
|
1578 | + exc->length = 0;
|
|
1600 | 1579 | exc->curRange = aRange;
|
1601 | 1580 | |
1602 | 1581 | return SUCCESS;
|
... | ... | @@ -1659,48 +1638,23 @@ |
1659 | 1638 | FT_UShort point,
|
1660 | 1639 | FT_F26Dot6 distance )
|
1661 | 1640 | {
|
1662 | - FT_F26Dot6 v;
|
|
1663 | - |
|
1641 | + FT_Fixed v;
|
|
1664 | 1642 | |
1665 | - v = exc->GS.freeVector.x;
|
|
1666 | 1643 | |
1644 | + v = exc->moveVector.x;
|
|
1667 | 1645 | if ( v != 0 )
|
1668 | 1646 | {
|
1669 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
1670 | - /* Exception to the post-IUP curfew: Allow the x component of */
|
|
1671 | - /* diagonal moves, but only post-IUP. DejaVu tries to adjust */
|
|
1672 | - /* diagonal stems like on `Z' and `z' post-IUP. */
|
|
1673 | - if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
|
|
1674 | - zone->cur[point].x = ADD_LONG( zone->cur[point].x,
|
|
1675 | - FT_MulDiv( distance,
|
|
1676 | - v,
|
|
1677 | - exc->F_dot_P ) );
|
|
1678 | - else
|
|
1679 | -#endif
|
|
1680 | - |
|
1681 | - if ( NO_SUBPIXEL_HINTING )
|
|
1682 | - zone->cur[point].x = ADD_LONG( zone->cur[point].x,
|
|
1683 | - FT_MulDiv( distance,
|
|
1684 | - v,
|
|
1685 | - exc->F_dot_P ) );
|
|
1647 | + zone->cur[point].x = ADD_LONG( zone->cur[point].x,
|
|
1648 | + FT_MulFix( distance, v ) );
|
|
1686 | 1649 | |
1687 | 1650 | zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
|
1688 | 1651 | }
|
1689 | 1652 | |
1690 | - v = exc->GS.freeVector.y;
|
|
1691 | - |
|
1653 | + v = exc->moveVector.y;
|
|
1692 | 1654 | if ( v != 0 )
|
1693 | 1655 | {
|
1694 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
1695 | - if ( !( SUBPIXEL_HINTING_MINIMAL &&
|
|
1696 | - exc->backward_compatibility &&
|
|
1697 | - exc->iupx_called &&
|
|
1698 | - exc->iupy_called ) )
|
|
1699 | -#endif
|
|
1700 | - zone->cur[point].y = ADD_LONG( zone->cur[point].y,
|
|
1701 | - FT_MulDiv( distance,
|
|
1702 | - v,
|
|
1703 | - exc->F_dot_P ) );
|
|
1656 | + zone->cur[point].y = ADD_LONG( zone->cur[point].y,
|
|
1657 | + FT_MulFix( distance, v ) );
|
|
1704 | 1658 | |
1705 | 1659 | zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
|
1706 | 1660 | }
|
... | ... | @@ -1733,24 +1687,18 @@ |
1733 | 1687 | FT_UShort point,
|
1734 | 1688 | FT_F26Dot6 distance )
|
1735 | 1689 | {
|
1736 | - FT_F26Dot6 v;
|
|
1737 | - |
|
1690 | + FT_Fixed v;
|
|
1738 | 1691 | |
1739 | - v = exc->GS.freeVector.x;
|
|
1740 | 1692 | |
1693 | + v = exc->moveVector.x;
|
|
1741 | 1694 | if ( v != 0 )
|
1742 | 1695 | zone->org[point].x = ADD_LONG( zone->org[point].x,
|
1743 | - FT_MulDiv( distance,
|
|
1744 | - v,
|
|
1745 | - exc->F_dot_P ) );
|
|
1746 | - |
|
1747 | - v = exc->GS.freeVector.y;
|
|
1696 | + FT_MulFix( distance, v ) );
|
|
1748 | 1697 | |
1698 | + v = exc->moveVector.y;
|
|
1749 | 1699 | if ( v != 0 )
|
1750 | 1700 | zone->org[point].y = ADD_LONG( zone->org[point].y,
|
1751 | - FT_MulDiv( distance,
|
|
1752 | - v,
|
|
1753 | - exc->F_dot_P ) );
|
|
1701 | + FT_MulFix( distance, v ) );
|
|
1754 | 1702 | }
|
1755 | 1703 | |
1756 | 1704 | |
... | ... | @@ -1771,14 +1719,9 @@ |
1771 | 1719 | FT_UShort point,
|
1772 | 1720 | FT_F26Dot6 distance )
|
1773 | 1721 | {
|
1774 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
1775 | - if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
|
|
1776 | - zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
|
|
1777 | - else
|
|
1778 | -#endif
|
|
1722 | + FT_UNUSED( exc );
|
|
1779 | 1723 | |
1780 | - if ( NO_SUBPIXEL_HINTING )
|
|
1781 | - zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
|
|
1724 | + zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
|
|
1782 | 1725 | |
1783 | 1726 | zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
|
1784 | 1727 | }
|
... | ... | @@ -1792,12 +1735,7 @@ |
1792 | 1735 | {
|
1793 | 1736 | FT_UNUSED( exc );
|
1794 | 1737 | |
1795 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
1796 | - if ( !( SUBPIXEL_HINTING_MINIMAL &&
|
|
1797 | - exc->backward_compatibility &&
|
|
1798 | - exc->iupx_called && exc->iupy_called ) )
|
|
1799 | -#endif
|
|
1800 | - zone->cur[point].y = ADD_LONG( zone->cur[point].y, distance );
|
|
1738 | + zone->cur[point].y = ADD_LONG( zone->cur[point].y, distance );
|
|
1801 | 1739 | |
1802 | 1740 | zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
|
1803 | 1741 | }
|
... | ... | @@ -2469,14 +2407,56 @@ |
2469 | 2407 | static void
|
2470 | 2408 | Compute_Funcs( TT_ExecContext exc )
|
2471 | 2409 | {
|
2472 | - if ( exc->GS.freeVector.x == 0x4000 )
|
|
2473 | - exc->F_dot_P = exc->GS.projVector.x;
|
|
2474 | - else if ( exc->GS.freeVector.y == 0x4000 )
|
|
2475 | - exc->F_dot_P = exc->GS.projVector.y;
|
|
2410 | + FT_Long F_dot_P =
|
|
2411 | + ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x +
|
|
2412 | + (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y +
|
|
2413 | + 0x2000L ) >> 14;
|
|
2414 | + |
|
2415 | + |
|
2416 | + if ( F_dot_P >= 0x3FFEL )
|
|
2417 | + {
|
|
2418 | + /* commonly collinear */
|
|
2419 | + exc->moveVector.x = exc->GS.freeVector.x << 2;
|
|
2420 | + exc->moveVector.y = exc->GS.freeVector.y << 2;
|
|
2421 | + }
|
|
2422 | + else if ( -0x400L < F_dot_P && F_dot_P < 0x400L )
|
|
2423 | + {
|
|
2424 | + /* prohibitively orthogonal */
|
|
2425 | + exc->moveVector.x = 0;
|
|
2426 | + exc->moveVector.y = 0;
|
|
2427 | + }
|
|
2476 | 2428 | else
|
2477 | - exc->F_dot_P =
|
|
2478 | - ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x +
|
|
2479 | - (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y ) >> 14;
|
|
2429 | + {
|
|
2430 | + exc->moveVector.x = ( exc->GS.freeVector.x << 16 ) / F_dot_P;
|
|
2431 | + exc->moveVector.y = ( exc->GS.freeVector.y << 16 ) / F_dot_P;
|
|
2432 | + }
|
|
2433 | + |
|
2434 | +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
2435 | + /* This effectively suppresses certain point movements! */
|
|
2436 | + if ( SUBPIXEL_HINTING_MINIMAL && exc->backward_compatibility )
|
|
2437 | + {
|
|
2438 | + exc->moveVector.x = 0;
|
|
2439 | + |
|
2440 | + if ( exc->iupx_called && exc->iupy_called )
|
|
2441 | + exc->moveVector.y = 0;
|
|
2442 | + }
|
|
2443 | +#endif
|
|
2444 | + |
|
2445 | + if ( F_dot_P >= 0x3FFEL && exc->moveVector.x == 0x10000L )
|
|
2446 | + {
|
|
2447 | + exc->func_move = (TT_Move_Func)Direct_Move_X;
|
|
2448 | + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
|
|
2449 | + }
|
|
2450 | + else if ( F_dot_P >= 0x3FFEL && exc->moveVector.y == 0x10000L )
|
|
2451 | + {
|
|
2452 | + exc->func_move = (TT_Move_Func)Direct_Move_Y;
|
|
2453 | + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
|
|
2454 | + }
|
|
2455 | + else
|
|
2456 | + {
|
|
2457 | + exc->func_move = (TT_Move_Func)Direct_Move;
|
|
2458 | + exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig;
|
|
2459 | + }
|
|
2480 | 2460 | |
2481 | 2461 | if ( exc->GS.projVector.x == 0x4000 )
|
2482 | 2462 | exc->func_project = (TT_Project_Func)Project_x;
|
... | ... | @@ -2492,29 +2472,6 @@ |
2492 | 2472 | else
|
2493 | 2473 | exc->func_dualproj = (TT_Project_Func)Dual_Project;
|
2494 | 2474 | |
2495 | - exc->func_move = (TT_Move_Func)Direct_Move;
|
|
2496 | - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig;
|
|
2497 | - |
|
2498 | - if ( exc->F_dot_P == 0x4000L )
|
|
2499 | - {
|
|
2500 | - if ( exc->GS.freeVector.x == 0x4000 )
|
|
2501 | - {
|
|
2502 | - exc->func_move = (TT_Move_Func)Direct_Move_X;
|
|
2503 | - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
|
|
2504 | - }
|
|
2505 | - else if ( exc->GS.freeVector.y == 0x4000 )
|
|
2506 | - {
|
|
2507 | - exc->func_move = (TT_Move_Func)Direct_Move_Y;
|
|
2508 | - exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
|
|
2509 | - }
|
|
2510 | - }
|
|
2511 | - |
|
2512 | - /* at small sizes, F_dot_P can become too small, resulting */
|
|
2513 | - /* in overflows and `spikes' in a number of glyphs like `w'. */
|
|
2514 | - |
|
2515 | - if ( FT_ABS( exc->F_dot_P ) < 0x400L )
|
|
2516 | - exc->F_dot_P = 0x4000L;
|
|
2517 | - |
|
2518 | 2475 | /* Disable cached aspect ratio */
|
2519 | 2476 | exc->tt_metrics.ratio = 0;
|
2520 | 2477 | }
|
... | ... | @@ -3199,13 +3156,11 @@ |
3199 | 3156 | }
|
3200 | 3157 | else
|
3201 | 3158 | {
|
3202 | - K = exc->stack[exc->args - L];
|
|
3159 | + K = args[-L];
|
|
3203 | 3160 | |
3204 | - FT_ARRAY_MOVE( &exc->stack[exc->args - L ],
|
|
3205 | - &exc->stack[exc->args - L + 1],
|
|
3206 | - ( L - 1 ) );
|
|
3161 | + FT_ARRAY_MOVE( args - L, args - L + 1, L - 1 );
|
|
3207 | 3162 | |
3208 | - exc->stack[exc->args - 1] = K;
|
|
3163 | + args[-1] = K;
|
|
3209 | 3164 | }
|
3210 | 3165 | }
|
3211 | 3166 | |
... | ... | @@ -3232,7 +3187,7 @@ |
3232 | 3187 | args[0] = 0;
|
3233 | 3188 | }
|
3234 | 3189 | else
|
3235 | - args[0] = exc->stack[exc->args - L];
|
|
3190 | + args[0] = args[-L];
|
|
3236 | 3191 | }
|
3237 | 3192 | |
3238 | 3193 | |
... | ... | @@ -3302,8 +3257,7 @@ |
3302 | 3257 | exc->length = 2 - exc->length * exc->code[exc->IP + 1];
|
3303 | 3258 | }
|
3304 | 3259 | |
3305 | - if ( exc->IP + exc->length <= exc->codeSize )
|
|
3306 | - return SUCCESS;
|
|
3260 | + return SUCCESS;
|
|
3307 | 3261 | }
|
3308 | 3262 | |
3309 | 3263 | Fail_Overflow:
|
... | ... | @@ -3427,7 +3381,7 @@ |
3427 | 3381 | return;
|
3428 | 3382 | }
|
3429 | 3383 | |
3430 | - exc->step_ins = FALSE;
|
|
3384 | + exc->length = 0;
|
|
3431 | 3385 | |
3432 | 3386 | if ( args[0] < 0 )
|
3433 | 3387 | {
|
... | ... | @@ -3580,12 +3534,11 @@ |
3580 | 3534 | |
3581 | 3535 | pRec->Cur_Count--;
|
3582 | 3536 | |
3583 | - exc->step_ins = FALSE;
|
|
3584 | - |
|
3585 | 3537 | if ( pRec->Cur_Count > 0 )
|
3586 | 3538 | {
|
3587 | 3539 | exc->callTop++;
|
3588 | - exc->IP = pRec->Def->start;
|
|
3540 | + exc->IP = pRec->Def->start;
|
|
3541 | + exc->length = 0;
|
|
3589 | 3542 | }
|
3590 | 3543 | else
|
3591 | 3544 | /* Loop through the current function */
|
... | ... | @@ -3673,8 +3626,6 @@ |
3673 | 3626 | |
3674 | 3627 | Ins_Goto_CodeRange( exc, def->range, def->start );
|
3675 | 3628 | |
3676 | - exc->step_ins = FALSE;
|
|
3677 | - |
|
3678 | 3629 | return;
|
3679 | 3630 | |
3680 | 3631 | Fail:
|
... | ... | @@ -3752,8 +3703,6 @@ |
3752 | 3703 | |
3753 | 3704 | Ins_Goto_CodeRange( exc, def->range, def->start );
|
3754 | 3705 | |
3755 | - exc->step_ins = FALSE;
|
|
3756 | - |
|
3757 | 3706 | exc->loopcall_counter += (FT_ULong)args[0];
|
3758 | 3707 | if ( exc->loopcall_counter > exc->loopcall_counter_max )
|
3759 | 3708 | exc->error = FT_THROW( Execution_Too_Long );
|
... | ... | @@ -3858,10 +3807,23 @@ |
3858 | 3807 | Ins_NPUSHB( TT_ExecContext exc,
|
3859 | 3808 | FT_Long* args )
|
3860 | 3809 | {
|
3861 | - FT_UShort L, K;
|
|
3810 | + FT_Long IP = exc->IP;
|
|
3811 | + FT_Int L, K;
|
|
3862 | 3812 | |
3863 | 3813 | |
3864 | - L = (FT_UShort)exc->code[exc->IP + 1];
|
|
3814 | + if ( ++IP > exc->codeSize )
|
|
3815 | + {
|
|
3816 | + exc->error = FT_THROW( Code_Overflow );
|
|
3817 | + return;
|
|
3818 | + }
|
|
3819 | + |
|
3820 | + L = exc->code[IP];
|
|
3821 | + |
|
3822 | + if ( IP + L > exc->codeSize )
|
|
3823 | + {
|
|
3824 | + exc->error = FT_THROW( Code_Overflow );
|
|
3825 | + return;
|
|
3826 | + }
|
|
3865 | 3827 | |
3866 | 3828 | if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
|
3867 | 3829 | {
|
... | ... | @@ -3869,10 +3831,11 @@ |
3869 | 3831 | return;
|
3870 | 3832 | }
|
3871 | 3833 | |
3872 | - for ( K = 1; K <= L; K++ )
|
|
3873 | - args[K - 1] = exc->code[exc->IP + K + 1];
|
|
3834 | + for ( K = 0; K < L; K++ )
|
|
3835 | + args[K] = exc->code[++IP];
|
|
3874 | 3836 | |
3875 | 3837 | exc->new_top += L;
|
3838 | + exc->IP = IP;
|
|
3876 | 3839 | }
|
3877 | 3840 | |
3878 | 3841 | |
... | ... | @@ -3886,10 +3849,23 @@ |
3886 | 3849 | Ins_NPUSHW( TT_ExecContext exc,
|
3887 | 3850 | FT_Long* args )
|
3888 | 3851 | {
|
3889 | - FT_UShort L, K;
|
|
3852 | + FT_Long IP = exc->IP;
|
|
3853 | + FT_Int L, K;
|
|
3890 | 3854 | |
3891 | 3855 | |
3892 | - L = (FT_UShort)exc->code[exc->IP + 1];
|
|
3856 | + if ( ++IP > exc->codeSize )
|
|
3857 | + {
|
|
3858 | + exc->error = FT_THROW( Code_Overflow );
|
|
3859 | + return;
|
|
3860 | + }
|
|
3861 | + |
|
3862 | + L = exc->code[IP];
|
|
3863 | + |
|
3864 | + if ( IP + 2 * L > exc->codeSize )
|
|
3865 | + {
|
|
3866 | + exc->error = FT_THROW( Code_Overflow );
|
|
3867 | + return;
|
|
3868 | + }
|
|
3893 | 3869 | |
3894 | 3870 | if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
|
3895 | 3871 | {
|
... | ... | @@ -3897,13 +3873,12 @@ |
3897 | 3873 | return;
|
3898 | 3874 | }
|
3899 | 3875 | |
3900 | - exc->IP += 2;
|
|
3876 | + /* note casting for sign-extension */
|
|
3877 | + for ( K = 0; K < L; K++, IP += 2 )
|
|
3878 | + args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2];
|
|
3901 | 3879 | |
3902 | - for ( K = 0; K < L; K++ )
|
|
3903 | - args[K] = GetShortIns( exc );
|
|
3904 | - |
|
3905 | - exc->step_ins = FALSE;
|
|
3906 | 3880 | exc->new_top += L;
|
3881 | + exc->IP = IP;
|
|
3907 | 3882 | }
|
3908 | 3883 | |
3909 | 3884 | |
... | ... | @@ -3917,10 +3892,17 @@ |
3917 | 3892 | Ins_PUSHB( TT_ExecContext exc,
|
3918 | 3893 | FT_Long* args )
|
3919 | 3894 | {
|
3920 | - FT_UShort L, K;
|
|
3895 | + FT_Long IP = exc->IP;
|
|
3896 | + FT_Int L, K;
|
|
3921 | 3897 | |
3922 | 3898 | |
3923 | - L = (FT_UShort)( exc->opcode - 0xB0 + 1 );
|
|
3899 | + L = exc->opcode - 0xB0 + 1;
|
|
3900 | + |
|
3901 | + if ( IP + L > exc->codeSize )
|
|
3902 | + {
|
|
3903 | + exc->error = FT_THROW( Code_Overflow );
|
|
3904 | + return;
|
|
3905 | + }
|
|
3924 | 3906 | |
3925 | 3907 | if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
|
3926 | 3908 | {
|
... | ... | @@ -3928,8 +3910,10 @@ |
3928 | 3910 | return;
|
3929 | 3911 | }
|
3930 | 3912 | |
3931 | - for ( K = 1; K <= L; K++ )
|
|
3932 | - args[K - 1] = exc->code[exc->IP + K];
|
|
3913 | + for ( K = 0; K < L; K++ )
|
|
3914 | + args[K] = exc->code[++IP];
|
|
3915 | + |
|
3916 | + exc->IP = IP;
|
|
3933 | 3917 | }
|
3934 | 3918 | |
3935 | 3919 | |
... | ... | @@ -3943,10 +3927,17 @@ |
3943 | 3927 | Ins_PUSHW( TT_ExecContext exc,
|
3944 | 3928 | FT_Long* args )
|
3945 | 3929 | {
|
3946 | - FT_UShort L, K;
|
|
3930 | + FT_Long IP = exc->IP;
|
|
3931 | + FT_Int L, K;
|
|
3947 | 3932 | |
3948 | 3933 | |
3949 | - L = (FT_UShort)( exc->opcode - 0xB8 + 1 );
|
|
3934 | + L = exc->opcode - 0xB8 + 1;
|
|
3935 | + |
|
3936 | + if ( IP + 2 * L > exc->codeSize )
|
|
3937 | + {
|
|
3938 | + exc->error = FT_THROW( Code_Overflow );
|
|
3939 | + return;
|
|
3940 | + }
|
|
3950 | 3941 | |
3951 | 3942 | if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
|
3952 | 3943 | {
|
... | ... | @@ -3954,12 +3945,11 @@ |
3954 | 3945 | return;
|
3955 | 3946 | }
|
3956 | 3947 | |
3957 | - exc->IP++;
|
|
3958 | - |
|
3959 | - for ( K = 0; K < L; K++ )
|
|
3960 | - args[K] = GetShortIns( exc );
|
|
3948 | + /* note casting for sign-extension */
|
|
3949 | + for ( K = 0; K < L; K++, IP += 2 )
|
|
3950 | + args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2];
|
|
3961 | 3951 | |
3962 | - exc->step_ins = FALSE;
|
|
3952 | + exc->IP = IP;
|
|
3963 | 3953 | }
|
3964 | 3954 | |
3965 | 3955 | |
... | ... | @@ -4987,11 +4977,22 @@ |
4987 | 4977 | * Stack: uint32... -->
|
4988 | 4978 | */
|
4989 | 4979 | static void
|
4990 | - Ins_FLIPPT( TT_ExecContext exc )
|
|
4980 | + Ins_FLIPPT( TT_ExecContext exc,
|
|
4981 | + FT_Long* args )
|
|
4991 | 4982 | {
|
4983 | + FT_Long loop = exc->GS.loop;
|
|
4992 | 4984 | FT_UShort point;
|
4993 | 4985 | |
4994 | 4986 | |
4987 | + if ( exc->new_top < loop )
|
|
4988 | + {
|
|
4989 | + if ( exc->pedantic_hinting )
|
|
4990 | + exc->error = FT_THROW( Too_Few_Arguments );
|
|
4991 | + goto Fail;
|
|
4992 | + }
|
|
4993 | + |
|
4994 | + exc->new_top -= loop;
|
|
4995 | + |
|
4995 | 4996 | #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
4996 | 4997 | /* See `ttinterp.h' for details on backward compatibility mode. */
|
4997 | 4998 | if ( SUBPIXEL_HINTING_MINIMAL &&
|
... | ... | @@ -5001,18 +5002,9 @@ |
5001 | 5002 | goto Fail;
|
5002 | 5003 | #endif
|
5003 | 5004 | |
5004 | - if ( exc->top < exc->GS.loop )
|
|
5005 | - {
|
|
5006 | - if ( exc->pedantic_hinting )
|
|
5007 | - exc->error = FT_THROW( Too_Few_Arguments );
|
|
5008 | - goto Fail;
|
|
5009 | - }
|
|
5010 | - |
|
5011 | - while ( exc->GS.loop > 0 )
|
|
5005 | + while ( loop-- )
|
|
5012 | 5006 | {
|
5013 | - exc->args--;
|
|
5014 | - |
|
5015 | - point = (FT_UShort)exc->stack[exc->args];
|
|
5007 | + point = (FT_UShort)*(--args);
|
|
5016 | 5008 | |
5017 | 5009 | if ( BOUNDS( point, exc->pts.n_points ) )
|
5018 | 5010 | {
|
... | ... | @@ -5024,13 +5016,10 @@ |
5024 | 5016 | }
|
5025 | 5017 | else
|
5026 | 5018 | exc->pts.tags[point] ^= FT_CURVE_TAG_ON;
|
5027 | - |
|
5028 | - exc->GS.loop--;
|
|
5029 | 5019 | }
|
5030 | 5020 | |
5031 | 5021 | Fail:
|
5032 | 5022 | exc->GS.loop = 1;
|
5033 | - exc->new_top = exc->args;
|
|
5034 | 5023 | }
|
5035 | 5024 | |
5036 | 5025 | |
... | ... | @@ -5146,8 +5135,8 @@ |
5146 | 5135 | |
5147 | 5136 | d = PROJECT( zp.cur + p, zp.org + p );
|
5148 | 5137 | |
5149 | - *x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P );
|
|
5150 | - *y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P );
|
|
5138 | + *x = FT_MulFix( d, exc->moveVector.x );
|
|
5139 | + *y = FT_MulFix( d, exc->moveVector.y );
|
|
5151 | 5140 | |
5152 | 5141 | return SUCCESS;
|
5153 | 5142 | }
|
... | ... | @@ -5163,11 +5152,7 @@ |
5163 | 5152 | {
|
5164 | 5153 | if ( exc->GS.freeVector.x != 0 )
|
5165 | 5154 | {
|
5166 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
5167 | - if ( !( SUBPIXEL_HINTING_MINIMAL &&
|
|
5168 | - exc->backward_compatibility ) )
|
|
5169 | -#endif
|
|
5170 | - exc->zp2.cur[point].x = ADD_LONG( exc->zp2.cur[point].x, dx );
|
|
5155 | + exc->zp2.cur[point].x = ADD_LONG( exc->zp2.cur[point].x, dx );
|
|
5171 | 5156 | |
5172 | 5157 | if ( touch )
|
5173 | 5158 | exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
|
... | ... | @@ -5175,13 +5160,7 @@ |
5175 | 5160 | |
5176 | 5161 | if ( exc->GS.freeVector.y != 0 )
|
5177 | 5162 | {
|
5178 | -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
5179 | - if ( !( SUBPIXEL_HINTING_MINIMAL &&
|
|
5180 | - exc->backward_compatibility &&
|
|
5181 | - exc->iupx_called &&
|
|
5182 | - exc->iupy_called ) )
|
|
5183 | -#endif
|
|
5184 | - exc->zp2.cur[point].y = ADD_LONG( exc->zp2.cur[point].y, dy );
|
|
5163 | + exc->zp2.cur[point].y = ADD_LONG( exc->zp2.cur[point].y, dy );
|
|
5185 | 5164 | |
5186 | 5165 | if ( touch )
|
5187 | 5166 | exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
|
... | ... | @@ -5196,8 +5175,10 @@ |
5196 | 5175 | * Stack: uint32... -->
|
5197 | 5176 | */
|
5198 | 5177 | static void
|
5199 | - Ins_SHP( TT_ExecContext exc )
|
|
5178 | + Ins_SHP( TT_ExecContext exc,
|
|
5179 | + FT_Long* args )
|
|
5200 | 5180 | {
|
5181 | + FT_Long loop = exc->GS.loop;
|
|
5201 | 5182 | TT_GlyphZoneRec zp;
|
5202 | 5183 | FT_UShort refp;
|
5203 | 5184 | |
... | ... | @@ -5205,20 +5186,21 @@ |
5205 | 5186 | FT_UShort point;
|
5206 | 5187 | |
5207 | 5188 | |
5208 | - if ( exc->top < exc->GS.loop )
|
|
5189 | + if ( exc->new_top < loop )
|
|
5209 | 5190 | {
|
5210 | 5191 | if ( exc->pedantic_hinting )
|
5211 | 5192 | exc->error = FT_THROW( Invalid_Reference );
|
5212 | 5193 | goto Fail;
|
5213 | 5194 | }
|
5214 | 5195 | |
5196 | + exc->new_top -= loop;
|
|
5197 | + |
|
5215 | 5198 | if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
|
5216 | 5199 | return;
|
5217 | 5200 | |
5218 | - while ( exc->GS.loop > 0 )
|
|
5201 | + while ( loop-- )
|
|
5219 | 5202 | {
|
5220 | - exc->args--;
|
|
5221 | - point = (FT_UShort)exc->stack[exc->args];
|
|
5203 | + point = (FT_UShort)*(--args);
|
|
5222 | 5204 | |
5223 | 5205 | if ( BOUNDS( point, exc->zp2.n_points ) )
|
5224 | 5206 | {
|
... | ... | @@ -5230,13 +5212,10 @@ |
5230 | 5212 | }
|
5231 | 5213 | else
|
5232 | 5214 | Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5233 | - |
|
5234 | - exc->GS.loop--;
|
|
5235 | 5215 | }
|
5236 | 5216 | |
5237 | 5217 | Fail:
|
5238 | 5218 | exc->GS.loop = 1;
|
5239 | - exc->new_top = exc->args;
|
|
5240 | 5219 | }
|
5241 | 5220 | |
5242 | 5221 | |
... | ... | @@ -5352,6 +5331,7 @@ |
5352 | 5331 | Ins_SHPIX( TT_ExecContext exc,
|
5353 | 5332 | FT_Long* args )
|
5354 | 5333 | {
|
5334 | + FT_Long loop = exc->GS.loop;
|
|
5355 | 5335 | FT_F26Dot6 dx, dy;
|
5356 | 5336 | FT_UShort point;
|
5357 | 5337 | #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
... | ... | @@ -5361,22 +5341,21 @@ |
5361 | 5341 | #endif
|
5362 | 5342 | |
5363 | 5343 | |
5364 | - |
|
5365 | - if ( exc->top < exc->GS.loop + 1 )
|
|
5344 | + if ( exc->new_top < loop )
|
|
5366 | 5345 | {
|
5367 | 5346 | if ( exc->pedantic_hinting )
|
5368 | 5347 | exc->error = FT_THROW( Invalid_Reference );
|
5369 | 5348 | goto Fail;
|
5370 | 5349 | }
|
5371 | 5350 | |
5351 | + exc->new_top -= loop;
|
|
5352 | + |
|
5372 | 5353 | dx = TT_MulFix14( args[0], exc->GS.freeVector.x );
|
5373 | 5354 | dy = TT_MulFix14( args[0], exc->GS.freeVector.y );
|
5374 | 5355 | |
5375 | - while ( exc->GS.loop > 0 )
|
|
5356 | + while ( loop-- )
|
|
5376 | 5357 | {
|
5377 | - exc->args--;
|
|
5378 | - |
|
5379 | - point = (FT_UShort)exc->stack[exc->args];
|
|
5358 | + point = (FT_UShort)*(--args);
|
|
5380 | 5359 | |
5381 | 5360 | if ( BOUNDS( point, exc->zp2.n_points ) )
|
5382 | 5361 | {
|
... | ... | @@ -5405,13 +5384,10 @@ |
5405 | 5384 | else
|
5406 | 5385 | #endif
|
5407 | 5386 | Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5408 | - |
|
5409 | - exc->GS.loop--;
|
|
5410 | 5387 | }
|
5411 | 5388 | |
5412 | 5389 | Fail:
|
5413 | 5390 | exc->GS.loop = 1;
|
5414 | - exc->new_top = exc->args;
|
|
5415 | 5391 | }
|
5416 | 5392 | |
5417 | 5393 | |
... | ... | @@ -5865,13 +5841,15 @@ |
5865 | 5841 | * Stack: uint32 uint32... -->
|
5866 | 5842 | */
|
5867 | 5843 | static void
|
5868 | - Ins_ALIGNRP( TT_ExecContext exc )
|
|
5844 | + Ins_ALIGNRP( TT_ExecContext exc,
|
|
5845 | + FT_Long* args )
|
|
5869 | 5846 | {
|
5847 | + FT_Long loop = exc->GS.loop;
|
|
5870 | 5848 | FT_UShort point;
|
5871 | 5849 | FT_F26Dot6 distance;
|
5872 | 5850 | |
5873 | 5851 | |
5874 | - if ( exc->top < exc->GS.loop ||
|
|
5852 | + if ( exc->new_top < loop ||
|
|
5875 | 5853 | BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
|
5876 | 5854 | {
|
5877 | 5855 | if ( exc->pedantic_hinting )
|
... | ... | @@ -5879,11 +5857,11 @@ |
5879 | 5857 | goto Fail;
|
5880 | 5858 | }
|
5881 | 5859 | |
5882 | - while ( exc->GS.loop > 0 )
|
|
5883 | - {
|
|
5884 | - exc->args--;
|
|
5860 | + exc->new_top -= loop;
|
|
5885 | 5861 | |
5886 | - point = (FT_UShort)exc->stack[exc->args];
|
|
5862 | + while ( loop-- )
|
|
5863 | + {
|
|
5864 | + point = (FT_UShort)*(--args);
|
|
5887 | 5865 | |
5888 | 5866 | if ( BOUNDS( point, exc->zp1.n_points ) )
|
5889 | 5867 | {
|
... | ... | @@ -5900,13 +5878,10 @@ |
5900 | 5878 | |
5901 | 5879 | exc->func_move( exc, &exc->zp1, point, NEG_LONG( distance ) );
|
5902 | 5880 | }
|
5903 | - |
|
5904 | - exc->GS.loop--;
|
|
5905 | 5881 | }
|
5906 | 5882 | |
5907 | 5883 | Fail:
|
5908 | 5884 | exc->GS.loop = 1;
|
5909 | - exc->new_top = exc->args;
|
|
5910 | 5885 | }
|
5911 | 5886 | |
5912 | 5887 | |
... | ... | @@ -6048,21 +6023,25 @@ |
6048 | 6023 | /* SOMETIMES, DUMBER CODE IS BETTER CODE */
|
6049 | 6024 | |
6050 | 6025 | static void
|
6051 | - Ins_IP( TT_ExecContext exc )
|
|
6026 | + Ins_IP( TT_ExecContext exc,
|
|
6027 | + FT_Long* args )
|
|
6052 | 6028 | {
|
6029 | + FT_Long loop = exc->GS.loop;
|
|
6053 | 6030 | FT_F26Dot6 old_range, cur_range;
|
6054 | 6031 | FT_Vector* orus_base;
|
6055 | 6032 | FT_Vector* cur_base;
|
6056 | 6033 | FT_Int twilight;
|
6057 | 6034 | |
6058 | 6035 | |
6059 | - if ( exc->top < exc->GS.loop )
|
|
6036 | + if ( exc->new_top < loop )
|
|
6060 | 6037 | {
|
6061 | 6038 | if ( exc->pedantic_hinting )
|
6062 | 6039 | exc->error = FT_THROW( Invalid_Reference );
|
6063 | 6040 | goto Fail;
|
6064 | 6041 | }
|
6065 | 6042 | |
6043 | + exc->new_top -= loop;
|
|
6044 | + |
|
6066 | 6045 | /*
|
6067 | 6046 | * We need to deal in a special way with the twilight zone.
|
6068 | 6047 | * Otherwise, by definition, the value of exc->twilight.orus[n] is (0,0),
|
... | ... | @@ -6120,9 +6099,9 @@ |
6120 | 6099 | cur_range = PROJECT( &exc->zp1.cur[exc->GS.rp2], cur_base );
|
6121 | 6100 | }
|
6122 | 6101 | |
6123 | - for ( ; exc->GS.loop > 0; exc->GS.loop-- )
|
|
6102 | + while ( loop-- )
|
|
6124 | 6103 | {
|
6125 | - FT_UInt point = (FT_UInt)exc->stack[--exc->args];
|
|
6104 | + FT_UInt point = (FT_UInt)*(--args);
|
|
6126 | 6105 | FT_F26Dot6 org_dist, cur_dist, new_dist;
|
6127 | 6106 | |
6128 | 6107 | |
... | ... | @@ -6194,7 +6173,6 @@ |
6194 | 6173 | |
6195 | 6174 | Fail:
|
6196 | 6175 | exc->GS.loop = 1;
|
6197 | - exc->new_top = exc->args;
|
|
6198 | 6176 | }
|
6199 | 6177 | |
6200 | 6178 | |
... | ... | @@ -6403,6 +6381,9 @@ |
6403 | 6381 | exc->iupx_called = TRUE;
|
6404 | 6382 | else
|
6405 | 6383 | exc->iupy_called = TRUE;
|
6384 | + |
|
6385 | + if ( exc->iupx_called && exc->iupy_called )
|
|
6386 | + exc->moveVector.y = 0;
|
|
6406 | 6387 | }
|
6407 | 6388 | #endif
|
6408 | 6389 | |
... | ... | @@ -6495,30 +6476,29 @@ |
6495 | 6476 | Ins_DELTAP( TT_ExecContext exc,
|
6496 | 6477 | FT_Long* args )
|
6497 | 6478 | {
|
6498 | - FT_ULong nump, k;
|
|
6479 | + FT_Long nump;
|
|
6499 | 6480 | FT_UShort A;
|
6500 | 6481 | FT_ULong C, P;
|
6501 | 6482 | FT_Long B;
|
6502 | 6483 | |
6503 | 6484 | |
6504 | 6485 | P = (FT_ULong)exc->func_cur_ppem( exc );
|
6505 | - nump = (FT_ULong)args[0]; /* some points theoretically may occur more
|
|
6506 | - than once, thus UShort isn't enough */
|
|
6486 | + nump = args[0]; /* signed value for convenience */
|
|
6507 | 6487 | |
6508 | - for ( k = 1; k <= nump; k++ )
|
|
6488 | + if ( nump < 0 || nump > exc->new_top / 2 )
|
|
6509 | 6489 | {
|
6510 | - if ( exc->args < 2 )
|
|
6511 | - {
|
|
6512 | - if ( exc->pedantic_hinting )
|
|
6513 | - exc->error = FT_THROW( Too_Few_Arguments );
|
|
6514 | - exc->args = 0;
|
|
6515 | - goto Fail;
|
|
6516 | - }
|
|
6490 | + if ( exc->pedantic_hinting )
|
|
6491 | + exc->error = FT_THROW( Too_Few_Arguments );
|
|
6517 | 6492 | |
6518 | - exc->args -= 2;
|
|
6493 | + nump = exc->new_top / 2;
|
|
6494 | + }
|
|
6495 | + |
|
6496 | + exc->new_top -= 2 * nump;
|
|
6519 | 6497 | |
6520 | - A = (FT_UShort)exc->stack[exc->args + 1];
|
|
6521 | - B = exc->stack[exc->args];
|
|
6498 | + while ( nump-- )
|
|
6499 | + {
|
|
6500 | + A = (FT_UShort)*(--args);
|
|
6501 | + B = *(--args);
|
|
6522 | 6502 | |
6523 | 6503 | /* XXX: Because some popular fonts contain some invalid DeltaP */
|
6524 | 6504 | /* instructions, we simply ignore them when the stacked */
|
... | ... | @@ -6574,9 +6554,6 @@ |
6574 | 6554 | if ( exc->pedantic_hinting )
|
6575 | 6555 | exc->error = FT_THROW( Invalid_Reference );
|
6576 | 6556 | }
|
6577 | - |
|
6578 | - Fail:
|
|
6579 | - exc->new_top = exc->args;
|
|
6580 | 6557 | }
|
6581 | 6558 | |
6582 | 6559 | |
... | ... | @@ -6590,28 +6567,28 @@ |
6590 | 6567 | Ins_DELTAC( TT_ExecContext exc,
|
6591 | 6568 | FT_Long* args )
|
6592 | 6569 | {
|
6593 | - FT_ULong nump, k;
|
|
6570 | + FT_Long nump;
|
|
6594 | 6571 | FT_ULong A, C, P;
|
6595 | 6572 | FT_Long B;
|
6596 | 6573 | |
6597 | 6574 | |
6598 | 6575 | P = (FT_ULong)exc->func_cur_ppem( exc );
|
6599 | - nump = (FT_ULong)args[0];
|
|
6576 | + nump = args[0]; /* signed value for convenience */
|
|
6600 | 6577 | |
6601 | - for ( k = 1; k <= nump; k++ )
|
|
6578 | + if ( nump < 0 || nump > exc->new_top / 2 )
|
|
6602 | 6579 | {
|
6603 | - if ( exc->args < 2 )
|
|
6604 | - {
|
|
6605 | - if ( exc->pedantic_hinting )
|
|
6606 | - exc->error = FT_THROW( Too_Few_Arguments );
|
|
6607 | - exc->args = 0;
|
|
6608 | - goto Fail;
|
|
6609 | - }
|
|
6580 | + if ( exc->pedantic_hinting )
|
|
6581 | + exc->error = FT_THROW( Too_Few_Arguments );
|
|
6610 | 6582 | |
6611 | - exc->args -= 2;
|
|
6583 | + nump = exc->new_top / 2;
|
|
6584 | + }
|
|
6585 | + |
|
6586 | + exc->new_top -= 2 * nump;
|
|
6612 | 6587 | |
6613 | - A = (FT_ULong)exc->stack[exc->args + 1];
|
|
6614 | - B = exc->stack[exc->args];
|
|
6588 | + while ( nump-- )
|
|
6589 | + {
|
|
6590 | + A = (FT_ULong)*(--args);
|
|
6591 | + B = *(--args);
|
|
6615 | 6592 | |
6616 | 6593 | if ( BOUNDSL( A, exc->cvtSize ) )
|
6617 | 6594 | {
|
... | ... | @@ -6652,9 +6629,6 @@ |
6652 | 6629 | }
|
6653 | 6630 | }
|
6654 | 6631 | }
|
6655 | - |
|
6656 | - Fail:
|
|
6657 | - exc->new_top = exc->args;
|
|
6658 | 6632 | }
|
6659 | 6633 | |
6660 | 6634 | |
... | ... | @@ -6821,6 +6795,8 @@ |
6821 | 6795 | for ( i = 0; i < num_axes; i++ )
|
6822 | 6796 | args[i] = 0;
|
6823 | 6797 | }
|
6798 | + |
|
6799 | + exc->new_top += num_axes;
|
|
6824 | 6800 | }
|
6825 | 6801 | |
6826 | 6802 | |
... | ... | @@ -6871,7 +6847,6 @@ |
6871 | 6847 | |
6872 | 6848 | Ins_Goto_CodeRange( exc, def->range, def->start );
|
6873 | 6849 | |
6874 | - exc->step_ins = FALSE;
|
|
6875 | 6850 | return;
|
6876 | 6851 | }
|
6877 | 6852 | }
|
... | ... | @@ -7005,7 +6980,17 @@ |
7005 | 6980 | |
7006 | 6981 | do
|
7007 | 6982 | {
|
6983 | + /* increment instruction counter and check if we didn't */
|
|
6984 | + /* run this program for too long (e.g. infinite loops). */
|
|
6985 | + if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES )
|
|
6986 | + {
|
|
6987 | + exc->error = FT_THROW( Execution_Too_Long );
|
|
6988 | + goto LErrorLabel_;
|
|
6989 | + }
|
|
6990 | + |
|
6991 | + exc->error = FT_Err_Ok;
|
|
7008 | 6992 | exc->opcode = exc->code[exc->IP];
|
6993 | + exc->length = 1;
|
|
7009 | 6994 | |
7010 | 6995 | #ifdef FT_DEBUG_LEVEL_TRACE
|
7011 | 6996 | if ( ft_trace_levels[trace_ttinterp] >= 6 )
|
... | ... | @@ -7029,17 +7014,6 @@ |
7029 | 7014 | }
|
7030 | 7015 | #endif /* FT_DEBUG_LEVEL_TRACE */
|
7031 | 7016 | |
7032 | - if ( ( exc->length = opcode_length[exc->opcode] ) < 0 )
|
|
7033 | - {
|
|
7034 | - if ( exc->IP + 1 >= exc->codeSize )
|
|
7035 | - goto LErrorCodeOverflow_;
|
|
7036 | - |
|
7037 | - exc->length = 2 - exc->length * exc->code[exc->IP + 1];
|
|
7038 | - }
|
|
7039 | - |
|
7040 | - if ( exc->IP + exc->length > exc->codeSize )
|
|
7041 | - goto LErrorCodeOverflow_;
|
|
7042 | - |
|
7043 | 7017 | /* First, let's check for empty stack and overflow */
|
7044 | 7018 | exc->args = exc->top - ( Pop_Push_Count[exc->opcode] >> 4 );
|
7045 | 7019 | |
... | ... | @@ -7059,21 +7033,7 @@ |
7059 | 7033 | exc->args = 0;
|
7060 | 7034 | }
|
7061 | 7035 | |
7062 | -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
|
7063 | - if ( exc->opcode == 0x91 )
|
|
7064 | - {
|
|
7065 | - /* this is very special: GETVARIATION returns */
|
|
7066 | - /* a variable number of arguments */
|
|
7067 | - |
|
7068 | - /* it is the job of the application to `activate' GX handling, */
|
|
7069 | - /* that is, calling any of the GX API functions on the current */
|
|
7070 | - /* font to select a variation instance */
|
|
7071 | - if ( exc->face->blend )
|
|
7072 | - exc->new_top = exc->args + exc->face->blend->num_axis;
|
|
7073 | - }
|
|
7074 | - else
|
|
7075 | -#endif
|
|
7076 | - exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
|
|
7036 | + exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
|
|
7077 | 7037 | |
7078 | 7038 | /* `new_top' is the new top of the stack, after the instruction's */
|
7079 | 7039 | /* execution. `top' will be set to `new_top' after the `switch' */
|
... | ... | @@ -7084,9 +7044,6 @@ |
7084 | 7044 | goto LErrorLabel_;
|
7085 | 7045 | }
|
7086 | 7046 | |
7087 | - exc->step_ins = TRUE;
|
|
7088 | - exc->error = FT_Err_Ok;
|
|
7089 | - |
|
7090 | 7047 | {
|
7091 | 7048 | FT_Long* args = exc->stack + exc->args;
|
7092 | 7049 | FT_Byte opcode = exc->opcode;
|
... | ... | @@ -7269,7 +7226,7 @@ |
7269 | 7226 | |
7270 | 7227 | case 0x32: /* SHP */
|
7271 | 7228 | case 0x33: /* SHP */
|
7272 | - Ins_SHP( exc );
|
|
7229 | + Ins_SHP( exc, args );
|
|
7273 | 7230 | break;
|
7274 | 7231 | |
7275 | 7232 | case 0x34: /* SHC */
|
... | ... | @@ -7287,7 +7244,7 @@ |
7287 | 7244 | break;
|
7288 | 7245 | |
7289 | 7246 | case 0x39: /* IP */
|
7290 | - Ins_IP( exc );
|
|
7247 | + Ins_IP( exc, args );
|
|
7291 | 7248 | break;
|
7292 | 7249 | |
7293 | 7250 | case 0x3A: /* MSIRP */
|
... | ... | @@ -7296,7 +7253,7 @@ |
7296 | 7253 | break;
|
7297 | 7254 | |
7298 | 7255 | case 0x3C: /* AlignRP */
|
7299 | - Ins_ALIGNRP( exc );
|
|
7256 | + Ins_ALIGNRP( exc, args );
|
|
7300 | 7257 | break;
|
7301 | 7258 | |
7302 | 7259 | case 0x3D: /* RTDG */
|
... | ... | @@ -7532,7 +7489,7 @@ |
7532 | 7489 | break;
|
7533 | 7490 | |
7534 | 7491 | case 0x80: /* FLIPPT */
|
7535 | - Ins_FLIPPT( exc );
|
|
7492 | + Ins_FLIPPT( exc, args );
|
|
7536 | 7493 | break;
|
7537 | 7494 | |
7538 | 7495 | case 0x81: /* FLIPRGON */
|
... | ... | @@ -7630,13 +7587,13 @@ |
7630 | 7587 | {
|
7631 | 7588 | switch ( exc->error )
|
7632 | 7589 | {
|
7633 | - /* looking for redefined instructions */
|
|
7634 | 7590 | case FT_ERR( Invalid_Opcode ):
|
7635 | 7591 | {
|
7636 | 7592 | TT_DefRecord* def = exc->IDefs;
|
7637 | 7593 | TT_DefRecord* limit = FT_OFFSET( def, exc->numIDefs );
|
7638 | 7594 | |
7639 | 7595 | |
7596 | + /* looking for redefined instructions */
|
|
7640 | 7597 | for ( ; def < limit; def++ )
|
7641 | 7598 | {
|
7642 | 7599 | if ( def->active && exc->opcode == (FT_Byte)def->opc )
|
... | ... | @@ -7666,37 +7623,15 @@ |
7666 | 7623 | }
|
7667 | 7624 | }
|
7668 | 7625 | }
|
7669 | - |
|
7670 | - exc->error = FT_THROW( Invalid_Opcode );
|
|
7671 | - goto LErrorLabel_;
|
|
7672 | - |
|
7673 | -#if 0
|
|
7674 | - break; /* Unreachable code warning suppression. */
|
|
7675 | - /* Leave to remind in case a later change the editor */
|
|
7676 | - /* to consider break; */
|
|
7677 | -#endif
|
|
7626 | + FALL_THROUGH;
|
|
7678 | 7627 | |
7679 | 7628 | default:
|
7680 | 7629 | goto LErrorLabel_;
|
7681 | - |
|
7682 | -#if 0
|
|
7683 | - break;
|
|
7684 | -#endif
|
|
7685 | 7630 | }
|
7686 | 7631 | }
|
7687 | 7632 | |
7688 | 7633 | exc->top = exc->new_top;
|
7689 | - |
|
7690 | - if ( exc->step_ins )
|
|
7691 | - exc->IP += exc->length;
|
|
7692 | - |
|
7693 | - /* increment instruction counter and check if we didn't */
|
|
7694 | - /* run this program for too long (e.g. infinite loops). */
|
|
7695 | - if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES )
|
|
7696 | - {
|
|
7697 | - exc->error = FT_THROW( Execution_Too_Long );
|
|
7698 | - goto LErrorLabel_;
|
|
7699 | - }
|
|
7634 | + exc->IP += exc->length;
|
|
7700 | 7635 | |
7701 | 7636 | LSuiteLabel_:
|
7702 | 7637 | if ( exc->IP >= exc->codeSize )
|
... | ... | @@ -7718,9 +7653,6 @@ |
7718 | 7653 | |
7719 | 7654 | return FT_Err_Ok;
|
7720 | 7655 | |
7721 | - LErrorCodeOverflow_:
|
|
7722 | - exc->error = FT_THROW( Code_Overflow );
|
|
7723 | - |
|
7724 | 7656 | LErrorLabel_:
|
7725 | 7657 | if ( exc->error && !exc->instruction_trap )
|
7726 | 7658 | FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error ));
|
... | ... | @@ -116,7 +116,7 @@ FT_BEGIN_HEADER |
116 | 116 | |
117 | 117 | FT_Error error; /* last execution error */
|
118 | 118 | |
119 | - FT_Long top; /* @ top of exec. stack */
|
|
119 | + FT_Long top; /* @! top of exec. stack */
|
|
120 | 120 | |
121 | 121 | FT_Long stackSize; /* ! size of exec. stack */
|
122 | 122 | FT_Long* stack; /* ! current exec. stack */
|
... | ... | @@ -142,11 +142,9 @@ FT_BEGIN_HEADER |
142 | 142 | FT_Long IP; /* current instruction pointer */
|
143 | 143 | FT_Long codeSize; /* size of current range */
|
144 | 144 | |
145 | - FT_Byte opcode; /* current opcode */
|
|
146 | - FT_Int length; /* length of current opcode */
|
|
145 | + FT_Byte opcode; /* current opcode */
|
|
146 | + FT_Int length; /* opcode length or increment */
|
|
147 | 147 | |
148 | - FT_Bool step_ins; /* true if the interpreter must */
|
|
149 | - /* increment IP after ins. exec */
|
|
150 | 148 | FT_ULong cvtSize; /* ! */
|
151 | 149 | FT_Long* cvt; /* ! */
|
152 | 150 | FT_ULong glyfCvtSize;
|
... | ... | @@ -166,9 +164,9 @@ FT_BEGIN_HEADER |
166 | 164 | FT_UInt maxFunc; /* ! maximum function index */
|
167 | 165 | FT_UInt maxIns; /* ! maximum instruction index */
|
168 | 166 | |
169 | - FT_Int callTop, /* @ top of call stack during execution */
|
|
170 | - callSize; /* size of call stack */
|
|
171 | - TT_CallStack callStack; /* call stack */
|
|
167 | + FT_Int callTop, /* @! top of call stack during execution */
|
|
168 | + callSize; /* size of call stack */
|
|
169 | + TT_CallStack callStack; /* call stack */
|
|
172 | 170 | |
173 | 171 | FT_UShort maxPoints; /* capacity of this context's `pts' */
|
174 | 172 | FT_Short maxContours; /* record, expressed in points and */
|
... | ... | @@ -189,16 +187,14 @@ FT_BEGIN_HEADER |
189 | 187 | FT_Bool instruction_trap; /* ! If `True', the interpreter */
|
190 | 188 | /* exits after each instruction */
|
191 | 189 | |
192 | - TT_GraphicsState default_GS; /* graphics state resulting from */
|
|
193 | - /* the prep program */
|
|
194 | 190 | FT_Bool is_composite; /* true if the glyph is composite */
|
195 | 191 | FT_Bool pedantic_hinting; /* true if pedantic interpretation */
|
196 | 192 | |
197 | 193 | /* latest interpreter additions */
|
198 | 194 | |
199 | - FT_Long F_dot_P; /* dot product of freedom and projection */
|
|
200 | - /* vectors */
|
|
201 | - TT_Round_Func func_round; /* current rounding function */
|
|
195 | + TT_Round_Func func_round; /* current rounding function */
|
|
196 | + |
|
197 | + FT_Vector moveVector; /* "projected" freedom vector */
|
|
202 | 198 | |
203 | 199 | TT_Project_Func func_project, /* current projection function */
|
204 | 200 | func_dualproj, /* current dual proj. function */
|
... | ... | @@ -906,18 +906,12 @@ |
906 | 906 | if ( error )
|
907 | 907 | return error;
|
908 | 908 | |
909 | - exec->callTop = 0;
|
|
910 | - exec->top = 0;
|
|
909 | + exec->pedantic_hinting = pedantic;
|
|
911 | 910 | |
912 | 911 | exec->period = 64;
|
913 | 912 | exec->phase = 0;
|
914 | 913 | exec->threshold = 0;
|
915 | 914 | |
916 | - exec->instruction_trap = FALSE;
|
|
917 | - exec->F_dot_P = 0x4000L;
|
|
918 | - |
|
919 | - exec->pedantic_hinting = pedantic;
|
|
920 | - |
|
921 | 915 | {
|
922 | 916 | FT_Size_Metrics* size_metrics = &exec->metrics;
|
923 | 917 | TT_Size_Metrics* tt_metrics = &exec->tt_metrics;
|
... | ... | @@ -1012,11 +1006,6 @@ |
1012 | 1006 | if ( error )
|
1013 | 1007 | return error;
|
1014 | 1008 | |
1015 | - exec->callTop = 0;
|
|
1016 | - exec->top = 0;
|
|
1017 | - |
|
1018 | - exec->instruction_trap = FALSE;
|
|
1019 | - |
|
1020 | 1009 | exec->pedantic_hinting = pedantic;
|
1021 | 1010 | |
1022 | 1011 | TT_Set_CodeRange( exec,
|