diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftcrfont.c | 6 | ||||
| -rw-r--r-- | src/ftfont.c | 30 | ||||
| -rw-r--r-- | src/ftxfont.c | 2 | ||||
| -rw-r--r-- | src/xftfont.c | 2 |
4 files changed, 10 insertions, 30 deletions
diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 1c28a7ceb67..0c3b74ff289 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c | |||
| @@ -455,7 +455,7 @@ ftcrfont_shape (Lisp_Object lgstring, Lisp_Object direction) | |||
| 455 | } | 455 | } |
| 456 | #endif | 456 | #endif |
| 457 | 457 | ||
| 458 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | 458 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 459 | static int | 459 | static int |
| 460 | ftcrfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) | 460 | ftcrfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) |
| 461 | { | 461 | { |
| @@ -470,7 +470,7 @@ ftcrfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) | |||
| 470 | 470 | ||
| 471 | return result; | 471 | return result; |
| 472 | } | 472 | } |
| 473 | #endif /* HAVE_OTF_GET_VARIATION_GLYPHS || HAVE_FT_FACE_GETCHARVARIANTINDEX */ | 473 | #endif /* HAVE_OTF_GET_VARIATION_GLYPHS */ |
| 474 | 474 | ||
| 475 | static int | 475 | static int |
| 476 | ftcrfont_draw (struct glyph_string *s, | 476 | ftcrfont_draw (struct glyph_string *s, |
| @@ -583,7 +583,7 @@ struct font_driver const ftcrfont_driver = | |||
| 583 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF | 583 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF |
| 584 | .shape = ftcrfont_shape, | 584 | .shape = ftcrfont_shape, |
| 585 | #endif | 585 | #endif |
| 586 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | 586 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 587 | .get_variation_glyphs = ftcrfont_variation_glyphs, | 587 | .get_variation_glyphs = ftcrfont_variation_glyphs, |
| 588 | #endif | 588 | #endif |
| 589 | .filter_properties = ftfont_filter_properties, | 589 | .filter_properties = ftfont_filter_properties, |
diff --git a/src/ftfont.c b/src/ftfont.c index efd0fcbd8c0..97ab4d0e377 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -2820,41 +2820,21 @@ ftfont_shape (Lisp_Object lgstring, Lisp_Object direction) | |||
| 2820 | 2820 | ||
| 2821 | #endif /* HAVE_M17N_FLT */ | 2821 | #endif /* HAVE_M17N_FLT */ |
| 2822 | 2822 | ||
| 2823 | #endif /* HAVE_LIBOTF */ | 2823 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 2824 | 2824 | ||
| 2825 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | ||
| 2826 | int | 2825 | int |
| 2827 | ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) | 2826 | ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) |
| 2828 | { | 2827 | { |
| 2829 | struct font_info *ftfont_info = (struct font_info *) font; | 2828 | struct font_info *ftfont_info = (struct font_info *) font; |
| 2830 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS | ||
| 2831 | OTF *otf = ftfont_get_otf (ftfont_info); | 2829 | OTF *otf = ftfont_get_otf (ftfont_info); |
| 2832 | 2830 | ||
| 2833 | if (! otf) | 2831 | if (! otf) |
| 2834 | return 0; | 2832 | return 0; |
| 2835 | return OTF_get_variation_glyphs (otf, c, variations); | 2833 | return OTF_get_variation_glyphs (otf, c, variations); |
| 2836 | #else /* !HAVE_OTF_GET_VARIATION_GLYPHS */ | ||
| 2837 | FT_Face ft_face = ftfont_info->ft_size->face; | ||
| 2838 | int i, n = 0; | ||
| 2839 | |||
| 2840 | for (i = 0; i < 16; i++) | ||
| 2841 | { | ||
| 2842 | variations[i] = FT_Face_GetCharVariantIndex (ft_face, c, 0xFE00 + i); | ||
| 2843 | if (variations[i]) | ||
| 2844 | n++; | ||
| 2845 | } | ||
| 2846 | for (; i < 256; i++) | ||
| 2847 | { | ||
| 2848 | variations[i] = FT_Face_GetCharVariantIndex (ft_face, c, | ||
| 2849 | 0xE0100 + (i - 16)); | ||
| 2850 | if (variations[i]) | ||
| 2851 | n++; | ||
| 2852 | } | ||
| 2853 | |||
| 2854 | return n; | ||
| 2855 | #endif /* !HAVE_OTF_GET_VARIATION_GLYPHS */ | ||
| 2856 | } | 2834 | } |
| 2857 | #endif /* HAVE_OTF_GET_VARIATION_GLYPHS || HAVE_FT_FACE_GETCHARVARIANTINDEX */ | 2835 | |
| 2836 | #endif /* HAVE_OTF_GET_VARIATION_GLYPHS */ | ||
| 2837 | #endif /* HAVE_LIBOTF */ | ||
| 2858 | 2838 | ||
| 2859 | #ifdef HAVE_HARFBUZZ | 2839 | #ifdef HAVE_HARFBUZZ |
| 2860 | 2840 | ||
| @@ -2956,7 +2936,7 @@ static struct font_driver const ftfont_driver = | |||
| 2956 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF | 2936 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF |
| 2957 | .shape = ftfont_shape, | 2937 | .shape = ftfont_shape, |
| 2958 | #endif | 2938 | #endif |
| 2959 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | 2939 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 2960 | .get_variation_glyphs = ftfont_variation_glyphs, | 2940 | .get_variation_glyphs = ftfont_variation_glyphs, |
| 2961 | #endif | 2941 | #endif |
| 2962 | .filter_properties = ftfont_filter_properties, | 2942 | .filter_properties = ftfont_filter_properties, |
diff --git a/src/ftxfont.c b/src/ftxfont.c index b1467360ad6..da3e3fbae10 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c | |||
| @@ -351,7 +351,7 @@ struct font_driver const ftxfont_driver = | |||
| 351 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF | 351 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF |
| 352 | .shape = ftfont_shape, | 352 | .shape = ftfont_shape, |
| 353 | #endif | 353 | #endif |
| 354 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | 354 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 355 | .get_variation_glyphs = ftfont_variation_glyphs, | 355 | .get_variation_glyphs = ftfont_variation_glyphs, |
| 356 | #endif | 356 | #endif |
| 357 | .filter_properties = ftfont_filter_properties, | 357 | .filter_properties = ftfont_filter_properties, |
diff --git a/src/xftfont.c b/src/xftfont.c index 04cda12fb52..c1b93b76f57 100644 --- a/src/xftfont.c +++ b/src/xftfont.c | |||
| @@ -661,7 +661,7 @@ struct font_driver const xftfont_driver = | |||
| 661 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF | 661 | #if defined HAVE_M17N_FLT && defined HAVE_LIBOTF |
| 662 | .shape = xftfont_shape, | 662 | .shape = xftfont_shape, |
| 663 | #endif | 663 | #endif |
| 664 | #if defined HAVE_OTF_GET_VARIATION_GLYPHS || defined HAVE_FT_FACE_GETCHARVARIANTINDEX | 664 | #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
| 665 | .get_variation_glyphs = ftfont_variation_glyphs, | 665 | .get_variation_glyphs = ftfont_variation_glyphs, |
| 666 | #endif | 666 | #endif |
| 667 | .filter_properties = ftfont_filter_properties, | 667 | .filter_properties = ftfont_filter_properties, |