Mercurial > emacs
comparison src/xftfont.c @ 106538:500878bee91d
(struct xftfont_info): New member matrix.
(xftfont_open): Setup xftfont_info->matrix.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 12 Dec 2009 02:11:29 +0000 |
parents | 8671036bedc4 |
children | 3d091f151696 |
comparison
equal
deleted
inserted
replaced
106537:9a13ceca63a8 | 106538:500878bee91d |
---|---|
45 font. */ | 45 font. */ |
46 | 46 |
47 struct xftfont_info | 47 struct xftfont_info |
48 { | 48 { |
49 struct font font; | 49 struct font font; |
50 /* The following four members must be here in this order to be | 50 /* The following five members must be here in this order to be |
51 compatible with struct ftfont_info (in ftfont.c). */ | 51 compatible with struct ftfont_info (in ftfont.c). */ |
52 #ifdef HAVE_LIBOTF | 52 #ifdef HAVE_LIBOTF |
53 int maybe_otf; /* Flag to tell if this may be OTF or not. */ | 53 int maybe_otf; /* Flag to tell if this may be OTF or not. */ |
54 OTF *otf; | 54 OTF *otf; |
55 #endif /* HAVE_LIBOTF */ | 55 #endif /* HAVE_LIBOTF */ |
56 FT_Size ft_size; | 56 FT_Size ft_size; |
57 int index; | 57 int index; |
58 FT_Matrix matrix; | |
58 Display *display; | 59 Display *display; |
59 int screen; | 60 int screen; |
60 XftFont *xftfont; | 61 XftFont *xftfont; |
61 }; | 62 }; |
62 | 63 |
252 int spacing; | 253 int spacing; |
253 char name[256]; | 254 char name[256]; |
254 int len, i; | 255 int len, i; |
255 XGlyphInfo extents; | 256 XGlyphInfo extents; |
256 FT_Face ft_face; | 257 FT_Face ft_face; |
258 FcMatrix *matrix; | |
257 | 259 |
258 val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX)); | 260 val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX)); |
259 if (! CONSP (val)) | 261 if (! CONSP (val)) |
260 return Qnil; | 262 return Qnil; |
261 val = XCDR (val); | 263 val = XCDR (val); |
376 | 378 |
377 xftfont_info = (struct xftfont_info *) font; | 379 xftfont_info = (struct xftfont_info *) font; |
378 xftfont_info->display = display; | 380 xftfont_info->display = display; |
379 xftfont_info->screen = FRAME_X_SCREEN_NUMBER (f); | 381 xftfont_info->screen = FRAME_X_SCREEN_NUMBER (f); |
380 xftfont_info->xftfont = xftfont; | 382 xftfont_info->xftfont = xftfont; |
383 /* This means that there's no need of transformation. */ | |
384 xftfont_info->matrix.xx = 0; | |
385 if (FcPatternGetMatrix (xftfont->pattern, FC_MATRIX, 0, &matrix) | |
386 == FcResultMatch) | |
387 { | |
388 xftfont_info->matrix.xx = 0x10000L * matrix->xx; | |
389 xftfont_info->matrix.yy = 0x10000L * matrix->yy; | |
390 xftfont_info->matrix.xy = 0x10000L * matrix->xy; | |
391 xftfont_info->matrix.yx = 0x10000L * matrix->yx; | |
392 } | |
381 font->pixel_size = size; | 393 font->pixel_size = size; |
382 font->driver = &xftfont_driver; | 394 font->driver = &xftfont_driver; |
383 if (INTEGERP (AREF (entity, FONT_SPACING_INDEX))) | 395 if (INTEGERP (AREF (entity, FONT_SPACING_INDEX))) |
384 spacing = XINT (AREF (entity, FONT_SPACING_INDEX)); | 396 spacing = XINT (AREF (entity, FONT_SPACING_INDEX)); |
385 else | 397 else |