summaryrefslogtreecommitdiff
path: root/src/xftfont.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2009-12-12 02:11:29 +0000
committerKenichi Handa <handa@m17n.org>2009-12-12 02:11:29 +0000
commit91ce241591151ef366a505bb38182789bb6c293b (patch)
tree43f3b2242f7783ceef714ccb111aee0e83554975 /src/xftfont.c
parentd356f4fcff6652a6f81b8c91a60cbda41a70f44b (diff)
downloademacs-91ce241591151ef366a505bb38182789bb6c293b.tar.gz
(struct xftfont_info): New member matrix.
(xftfont_open): Setup xftfont_info->matrix.
Diffstat (limited to 'src/xftfont.c')
-rw-r--r--src/xftfont.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index e2819863f07..4675875496a 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -47,7 +47,7 @@ static Lisp_Object QChinting , QCautohint, QChintstyle, QCrgba, QCembolden;
struct xftfont_info
{
struct font font;
- /* The following four members must be here in this order to be
+ /* The following five members must be here in this order to be
compatible with struct ftfont_info (in ftfont.c). */
#ifdef HAVE_LIBOTF
int maybe_otf; /* Flag to tell if this may be OTF or not. */
@@ -55,6 +55,7 @@ struct xftfont_info
#endif /* HAVE_LIBOTF */
FT_Size ft_size;
int index;
+ FT_Matrix matrix;
Display *display;
int screen;
XftFont *xftfont;
@@ -254,6 +255,7 @@ xftfont_open (f, entity, pixel_size)
int len, i;
XGlyphInfo extents;
FT_Face ft_face;
+ FcMatrix *matrix;
val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX));
if (! CONSP (val))
@@ -378,6 +380,16 @@ xftfont_open (f, entity, pixel_size)
xftfont_info->display = display;
xftfont_info->screen = FRAME_X_SCREEN_NUMBER (f);
xftfont_info->xftfont = xftfont;
+ /* This means that there's no need of transformation. */
+ xftfont_info->matrix.xx = 0;
+ if (FcPatternGetMatrix (xftfont->pattern, FC_MATRIX, 0, &matrix)
+ == FcResultMatch)
+ {
+ xftfont_info->matrix.xx = 0x10000L * matrix->xx;
+ xftfont_info->matrix.yy = 0x10000L * matrix->yy;
+ xftfont_info->matrix.xy = 0x10000L * matrix->xy;
+ xftfont_info->matrix.yx = 0x10000L * matrix->yx;
+ }
font->pixel_size = size;
font->driver = &xftfont_driver;
if (INTEGERP (AREF (entity, FONT_SPACING_INDEX)))