aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftfont.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2019-06-02 13:30:21 +0900
committerYAMAMOTO Mitsuharu2019-06-02 13:30:21 +0900
commit2ae0c7a434dcdcc53e2ccfc758093714b0695c3b (patch)
treeb0a4ee4d142be9b3c171f933c43233ae303d6c0f /src/ftfont.c
parent1ab69630dcb8c7a1b1b4171211a7c8ebf11b0d1c (diff)
downloademacs-2ae0c7a434dcdcc53e2ccfc758093714b0695c3b.tar.gz
emacs-2ae0c7a434dcdcc53e2ccfc758093714b0695c3b.zip
Revert previous commit
This reverts commit 1ab69630dcb8c7a1b1b4171211a7c8ebf11b0d1c. It has a wrong commit message.
Diffstat (limited to 'src/ftfont.c')
-rw-r--r--src/ftfont.c30
1 files changed, 5 insertions, 25 deletions
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
2826int 2825int
2827ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) 2826ftfont_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,