annotate src/xftfont.c @ 94903:052e05b47926

* talk.el (talk): Simplify. Pass display arg to talk-add-display as a string. (talk-add-display): Simplify. Accept only string args.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 13 May 2008 20:50:01 +0000
parents 6218afb021ac
children 8cbdb26068b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
1 /* xftfont.c -- XFT font driver.
91556
0920231c95f2 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 91269
diff changeset
2 Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
0920231c95f2 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 91269
diff changeset
3 Copyright (C) 2006, 2007, 2008
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
4 National Institute of Advanced Industrial Science and Technology (AIST)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
5 Registration Number H13PRO009
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
6
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
7 This file is part of GNU Emacs.
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9 GNU Emacs is free software; you can redistribute it and/or modify
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
91556
0920231c95f2 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 91269
diff changeset
11 the Free Software Foundation; either version 3, or (at your option)
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12 any later version.
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
14 GNU Emacs is distributed in the hope that it will be useful,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17 GNU General Public License for more details.
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
20 along with GNU Emacs; see the file COPYING. If not, write to
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22 Boston, MA 02110-1301, USA. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
24 #include <config.h>
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
25 #include <stdio.h>
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
26 #include <X11/Xlib.h>
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27 #include <X11/Xft/Xft.h>
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
28
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
29 #include "lisp.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30 #include "dispextern.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31 #include "xterm.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
32 #include "frame.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33 #include "blockinput.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34 #include "character.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 #include "charset.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 #include "fontset.h"
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 #include "font.h"
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
38 #include "ftfont.h"
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 /* Xft font driver. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 static Lisp_Object Qxft;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 /* The actual structure for Xft font that can be casted to struct
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 font. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 struct xftfont_info
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 struct font font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 Display *display;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 int screen;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 XftFont *xftfont;
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
53 #ifdef HAVE_LIBOTF
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
54 int maybe_otf; /* Flag to tell if this may be OTF or not. */
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
55 OTF *otf;
91163
a12e3e58ec94 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 91143
diff changeset
56 #endif /* HAVE_LIBOTF */
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 };
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 /* Structure pointed by (struct face *)->extra */
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
60
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 struct xftface_info
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 {
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
63 XftColor xft_fg; /* color for face->foreground */
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
64 XftColor xft_bg; /* color for face->background */
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 };
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 static void xftfont_get_colors P_ ((FRAME_PTR, struct face *, GC gc,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 struct xftface_info *,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 XftColor *fg, XftColor *bg));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
72 /* Setup foreground and background colors of GC into FG and BG. If
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
73 XFTFACE_INFO is not NULL, reuse the colors in it if possible. BG
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
74 may be NULL. */
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
75
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 static void
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 xftfont_get_colors (f, face, gc, xftface_info, fg, bg)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 FRAME_PTR f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 struct face *face;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 GC gc;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 struct xftface_info *xftface_info;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 XftColor *fg, *bg;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84 if (xftface_info && face->gc == gc)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
86 *fg = xftface_info->xft_fg;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
87 if (bg)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
88 *bg = xftface_info->xft_bg;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
89 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
90 else
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
91 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
92 XGCValues xgcv;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93 int fg_done = 0, bg_done = 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 BLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 XGetGCValues (FRAME_X_DISPLAY (f), gc,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97 GCForeground | GCBackground, &xgcv);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 if (xftface_info)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 if (xgcv.foreground == face->foreground)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 *fg = xftface_info->xft_fg, fg_done = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 else if (xgcv.foreground == face->background)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 *fg = xftface_info->xft_bg, fg_done = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 if (! bg)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 bg_done = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 else if (xgcv.background == face->background)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 *bg = xftface_info->xft_bg, bg_done = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 else if (xgcv.background == face->foreground)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
109 *bg = xftface_info->xft_fg, bg_done = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
110 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
111
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
112 if (fg_done + bg_done < 2)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
113 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
114 XColor colors[2];
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
115
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
116 colors[0].pixel = fg->pixel = xgcv.foreground;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
117 if (bg)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118 colors[1].pixel = bg->pixel = xgcv.background;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119 XQueryColors (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), colors,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120 bg ? 2 : 1);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 fg->color.alpha = 0xFFFF;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 fg->color.red = colors[0].red;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 fg->color.green = colors[0].green;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 fg->color.blue = colors[0].blue;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 if (bg)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 bg->color.alpha = 0xFFFF;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 bg->color.red = colors[1].red;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 bg->color.green = colors[1].green;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130 bg->color.blue = colors[1].blue;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 UNBLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
134 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
135 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
136
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
137
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
138 static Lisp_Object xftfont_list P_ ((Lisp_Object, Lisp_Object));
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
139 static Lisp_Object xftfont_match P_ ((Lisp_Object, Lisp_Object));
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
140 static struct font *xftfont_open P_ ((FRAME_PTR, Lisp_Object, int));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
141 static void xftfont_close P_ ((FRAME_PTR, struct font *));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
142 static int xftfont_prepare_face P_ ((FRAME_PTR, struct face *));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
143 static void xftfont_done_face P_ ((FRAME_PTR, struct face *));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
144 static unsigned xftfont_encode_char P_ ((struct font *, int));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
145 static int xftfont_text_extents P_ ((struct font *, unsigned *, int,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
146 struct font_metrics *));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
147 static int xftfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
148
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
149 static int xftfont_anchor_point P_ ((struct font *, unsigned, int,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
150 int *, int *));
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
151 static int xftfont_end_for_frame P_ ((FRAME_PTR f));
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
152
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
153 struct font_driver xftfont_driver;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
154
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
155 static Lisp_Object
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
156 xftfont_list (frame, spec)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
157 Lisp_Object frame;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
158 Lisp_Object spec;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
159 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
160 Lisp_Object val = ftfont_driver.list (frame, spec);
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
161 int i;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
162
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
163 if (! NILP (val))
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
164 for (i = 0; i < ASIZE (val); i++)
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
165 ASET (AREF (val, i), FONT_TYPE_INDEX, Qxft);
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
166 return val;
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
167 }
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
168
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
169 static Lisp_Object
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
170 xftfont_match (frame, spec)
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
171 Lisp_Object frame;
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
172 Lisp_Object spec;
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
173 {
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
174 Lisp_Object entity = ftfont_driver.match (frame, spec);
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
175
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
176 if (VECTORP (entity))
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
177 ASET (entity, FONT_TYPE_INDEX, Qxft);
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
178 return entity;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180
90700
b165eceb829f (ftfont_font_format): Extern declaration.
Kenichi Handa <handa@m17n.org>
parents: 90675
diff changeset
181 extern Lisp_Object ftfont_font_format P_ ((FcPattern *));
b165eceb829f (ftfont_font_format): Extern declaration.
Kenichi Handa <handa@m17n.org>
parents: 90675
diff changeset
182
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 static FcChar8 ascii_printable[95];
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 static struct font *
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 xftfont_open (f, entity, pixel_size)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 FRAME_PTR f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 Lisp_Object entity;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
189 int pixel_size;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192 Display *display = FRAME_X_DISPLAY (f);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 Lisp_Object val;
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
194 FcPattern *pattern, *pat = NULL;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
195 FcChar8 *file;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
196 struct xftfont_info *xftfont_info = NULL;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
197 XFontStruct *xfont = NULL;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
198 struct font *font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
199 double size = 0;
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
200 XftFont *xftfont = NULL;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 int spacing;
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
202 char *name;
90442
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
203 int len;
90959
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
204 XGlyphInfo extents;
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
205 FT_Face ft_face;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
206
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
207 val = AREF (entity, FONT_EXTRA_INDEX);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
208 if (XTYPE (val) != Lisp_Misc
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209 || XMISCTYPE (val) != Lisp_Misc_Save_Value)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
210 return NULL;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
211 pattern = XSAVE_VALUE (val)->pointer;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
212 if (FcPatternGetString (pattern, FC_FILE, 0, &file) != FcResultMatch)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
213 return NULL;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
214
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
215 size = XINT (AREF (entity, FONT_SIZE_INDEX));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
216 if (size == 0)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
217 size = pixel_size;
90442
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
218
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
219 pat = FcPatternCreate ();
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
220 FcPatternAddString (pat, FC_FILE, file);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
221 FcPatternAddDouble (pat, FC_PIXEL_SIZE, pixel_size);
90712
8594053c8fec (xftfont_open): Don't enable antialias explicitly.
Kenichi Handa <handa@m17n.org>
parents: 90700
diff changeset
222 /*FcPatternAddBool (pat, FC_ANTIALIAS, FcTrue);*/
90714
698001835583 (xftfont_open): Call FcConfigSubstitute.
Kenichi Handa <handa@m17n.org>
parents: 90712
diff changeset
223 val = AREF (entity, FONT_FAMILY_INDEX);
698001835583 (xftfont_open): Call FcConfigSubstitute.
Kenichi Handa <handa@m17n.org>
parents: 90712
diff changeset
224 if (! NILP (val))
698001835583 (xftfont_open): Call FcConfigSubstitute.
Kenichi Handa <handa@m17n.org>
parents: 90712
diff changeset
225 FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) SDATA (SYMBOL_NAME (val)));
698001835583 (xftfont_open): Call FcConfigSubstitute.
Kenichi Handa <handa@m17n.org>
parents: 90712
diff changeset
226 FcConfigSubstitute (NULL, pat, FcMatchPattern);
90442
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
227
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
228 BLOCK_INPUT;
90589
697dcc1df88d (xftfont_open): Call XftDefaultSubstitute before
Kenichi Handa <handa@m17n.org>
parents: 90559
diff changeset
229 XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
230 xftfont = XftFontOpenPattern (display, pat);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
231 /* We should not destroy PAT here because it is kept in XFTFONT and
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
232 destroyed automatically when XFTFONT is closed. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
233 if (! xftfont)
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
234 goto err;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
235
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
236 xftfont_info = malloc (sizeof (struct xftfont_info));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
237 if (! xftfont_info)
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
238 goto err;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
239 xfont = malloc (sizeof (XFontStruct));
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
240 if (! xfont)
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
241 goto err;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242 xftfont_info->display = display;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243 xftfont_info->screen = FRAME_X_SCREEN_NUMBER (f);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
244 xftfont_info->xftfont = xftfont;
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
245 #ifdef HAVE_LIBOTF
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
246 ft_face = XftLockFace (xftfont);
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
247 xftfont_info->maybe_otf = ft_face->face_flags & FT_FACE_FLAG_SFNT;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
248 XftUnlockFace (xftfont);
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
249 xftfont_info->otf = NULL;
91163
a12e3e58ec94 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 91143
diff changeset
250 #endif /* HAVE_LIBOTF */
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 font = (struct font *) xftfont_info;
90675
dfe6bfcd570f (xftfont_open): Set font->format.
Kenichi Handa <handa@m17n.org>
parents: 90616
diff changeset
253 font->format = ftfont_font_format (xftfont->pattern);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
254 font->entity = entity;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 font->pixel_size = size;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 font->driver = &xftfont_driver;
90473
9c75458ea910 (xftfont_open): For generating a name, start from
Kenichi Handa <handa@m17n.org>
parents: 90460
diff changeset
257 len = 96;
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
258 name = malloc (len);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
259 while (name && font_unparse_fcname (entity, pixel_size, name, len) < 0)
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
260 {
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
261 char *new = realloc (name, len += 32);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
262
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
263 if (! new)
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
264 free (name);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
265 name = new;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
266 }
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
267 if (! name)
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
268 goto err;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
269 font->font.full_name = font->font.name = name;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
270 font->file_name = (char *) file;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
271 font->font.size = xftfont->max_advance_width;
90511
2cd8e24f656a (xftfont_open): Set charset related members to -1.
Kenichi Handa <handa@m17n.org>
parents: 90499
diff changeset
272 font->font.charset = font->encoding_charset = font->repertory_charset = -1;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
273
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
274 if (FcPatternGetInteger (xftfont->pattern, FC_SPACING, 0, &spacing)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
275 != FcResultMatch)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
276 spacing = FC_PROPORTIONAL;
90959
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
277 if (! ascii_printable[0])
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
278 {
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
279 int i;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
280 for (i = 0; i < 95; i++)
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
281 ascii_printable[i] = ' ' + i;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
282 }
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
283 if (spacing != FC_PROPORTIONAL)
90959
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
284 {
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
285 font->font.average_width = font->font.space_width
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
286 = xftfont->max_advance_width;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
287 XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents);
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
288 }
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289 else
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 XftTextExtents8 (display, xftfont, ascii_printable, 1, &extents);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 font->font.space_width = extents.xOff;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293 if (font->font.space_width <= 0)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 /* dirty workaround */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 font->font.space_width = pixel_size;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 font->font.average_width = (font->font.space_width + extents.xOff) / 95;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 }
90442
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
299 UNBLOCK_INPUT;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300
90959
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
301 font->ascent = xftfont->ascent;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
302 if (font->ascent < extents.y)
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
303 font->ascent = extents.y;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
304 font->descent = xftfont->descent;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
305 if (font->descent < extents.height - extents.y)
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
306 font->descent = extents.height - extents.y;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
307 font->font.height = font->ascent + font->descent;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
308
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 /* Unfortunately Xft doesn't provide a way to get minimum char
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 width. So, we use space_width instead. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 font->min_width = font->font.space_width;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
312
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 font->font.baseline_offset = 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 font->font.relative_compose = 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
315 font->font.default_ascent = 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
316 font->font.vertical_centering = 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
317
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318 /* Setup pseudo XFontStruct */
91907
21cc6c5f4996 (xftfont_default_fid): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 91556
diff changeset
319 xfont->fid = 0;
90959
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
320 xfont->ascent = font->ascent;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
321 xfont->descent = font->descent;
3f83c9d3f96c (xftfont_open): If one of font's ASCII glyph has
Kenichi Handa <handa@m17n.org>
parents: 90714
diff changeset
322 xfont->max_bounds.descent = font->descent;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 xfont->max_bounds.width = xftfont->max_advance_width;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 xfont->min_bounds.width = font->font.space_width;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 font->font.font = xfont;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327 dpyinfo->n_fonts++;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
328
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
329 /* Set global flag fonts_changed_p to non-zero if the font loaded
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
330 has a character with a smaller width than any other character
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 before, or if the font loaded has a smaller height than any other
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 font loaded before. If this happens, it will make a glyph matrix
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 reallocation necessary. */
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 if (dpyinfo->n_fonts == 1)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336 dpyinfo->smallest_font_height = font->font.height;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337 dpyinfo->smallest_char_width = font->min_width;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 fonts_changed_p = 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
339 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
340 else
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
341 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
342 if (dpyinfo->smallest_font_height > font->font.height)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
343 dpyinfo->smallest_font_height = font->font.height,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
344 fonts_changed_p |= 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
345 if (dpyinfo->smallest_char_width > font->min_width)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
346 dpyinfo->smallest_char_width = font->min_width,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
347 fonts_changed_p |= 1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
348 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
349
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
350 return font;
90460
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
351
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
352 err:
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
353 if (xftfont) XftFontClose (display, xftfont);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
354 UNBLOCK_INPUT;
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
355 if (xftfont_info) free (xftfont_info);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
356 if (xfont) free (xfont);
86449661f321 (xftfont_open): Change coding style of error
Kenichi Handa <handa@m17n.org>
parents: 90442
diff changeset
357 return NULL;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
358 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
359
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 static void
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
361 xftfont_close (f, font)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 FRAME_PTR f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
363 struct font *font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
364 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
365 struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
367 #ifdef HAVE_LIBOTF
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
368 if (xftfont_info->otf)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
369 OTF_close (xftfont_info->otf);
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
370 #endif
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
371 XftFontClose (xftfont_info->display, xftfont_info->xftfont);
90442
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
372 if (font->font.name)
d6abf2344438 (xftfont_open): Make the font name fontconfig's
Kenichi Handa <handa@m17n.org>
parents: 90427
diff changeset
373 free (font->font.name);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
374 free (font);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
375 FRAME_X_DISPLAY_INFO (f)->n_fonts--;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
376 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 static int
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379 xftfont_prepare_face (f, face)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
380 FRAME_PTR f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
381 struct face *face;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
382 {
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
383 struct xftface_info *xftface_info;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
384
90499
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
385 #if 0
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
386 /* This doesn't work if face->ascii_face doesn't use an Xft font. */
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
387 if (face != face->ascii_face)
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
388 {
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
389 face->extra = face->ascii_face->extra;
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
390 return 0;
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
391 }
90499
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
392 #endif
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
393
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
394 xftface_info = malloc (sizeof (struct xftface_info));
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
395 if (! xftface_info)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
396 return -1;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
397
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
398 BLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
399 xftfont_get_colors (f, face, face->gc, NULL,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
400 &xftface_info->xft_fg, &xftface_info->xft_bg);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
401 UNBLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
402
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
403 face->extra = xftface_info;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
404 return 0;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
405 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
406
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
407 static void
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
408 xftfont_done_face (f, face)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
409 FRAME_PTR f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
410 struct face *face;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
411 {
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
412 struct xftface_info *xftface_info;
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
413
90499
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
414 #if 0
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
415 /* This doesn't work if face->ascii_face doesn't use an Xft font. */
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
416 if (face != face->ascii_face
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
417 || ! face->extra)
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
418 return;
90499
32b8f672da38 (xftfont_prepare_face): Cancel previous change.
Kenichi Handa <handa@m17n.org>
parents: 90489
diff changeset
419 #endif
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
420
90489
78a820ef12db (xftfont_prepare_face): Make non-ascii face share
Kenichi Handa <handa@m17n.org>
parents: 90473
diff changeset
421 xftface_info = (struct xftface_info *) face->extra;
90527
63b888896eba * xftfont.c (xftfont_done_face): Call XftDrawDestroy only if xftface_info
Jan Djärv <jan.h.d@swipnet.se>
parents: 90511
diff changeset
422 if (xftface_info)
63b888896eba * xftfont.c (xftfont_done_face): Call XftDrawDestroy only if xftface_info
Jan Djärv <jan.h.d@swipnet.se>
parents: 90511
diff changeset
423 {
63b888896eba * xftfont.c (xftfont_done_face): Call XftDrawDestroy only if xftface_info
Jan Djärv <jan.h.d@swipnet.se>
parents: 90511
diff changeset
424 free (xftface_info);
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
425 face->extra = NULL;
90527
63b888896eba * xftfont.c (xftfont_done_face): Call XftDrawDestroy only if xftface_info
Jan Djärv <jan.h.d@swipnet.se>
parents: 90511
diff changeset
426 }
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
427 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
428
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
429 static unsigned
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
430 xftfont_encode_char (font, c)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
431 struct font *font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
432 int c;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
433 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
434 struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
435 unsigned code = XftCharIndex (xftfont_info->display, xftfont_info->xftfont,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
436 (FcChar32) c);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
437
91269
421d7c7d296a (xftfont_encode_char): Use the macro FONT_INVALID_CODE.
Kenichi Handa <handa@m17n.org>
parents: 91243
diff changeset
438 return (code ? code : FONT_INVALID_CODE);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
439 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
440
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
441 static int
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
442 xftfont_text_extents (font, code, nglyphs, metrics)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
443 struct font *font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
444 unsigned *code;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
445 int nglyphs;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
446 struct font_metrics *metrics;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
447 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
448 struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
449 XGlyphInfo extents;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
450
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
451 BLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
452 XftGlyphExtents (xftfont_info->display, xftfont_info->xftfont, code, nglyphs,
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
453 &extents);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
454 UNBLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
455 if (metrics)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
456 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
457 metrics->lbearing = - extents.x;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
458 metrics->rbearing = - extents.x + extents.width;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
459 metrics->width = extents.xOff;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
460 metrics->ascent = extents.y;
90616
68d59ef20174 (xftfont_text_extents): Fix calculation of descent
Kenichi Handa <handa@m17n.org>
parents: 90589
diff changeset
461 metrics->descent = extents.height - extents.y;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
462 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
463 return extents.xOff;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
464 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
465
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
466 static XftDraw *
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
467 xftfont_get_xft_draw (f)
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
468 FRAME_PTR f;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
469 {
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
470 XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver);;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
471
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
472 if (! xft_draw)
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
473 {
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
474 BLOCK_INPUT;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
475 xft_draw= XftDrawCreate (FRAME_X_DISPLAY (f),
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
476 FRAME_X_WINDOW (f),
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
477 FRAME_X_VISUAL (f),
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
478 FRAME_X_COLORMAP (f));
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
479 UNBLOCK_INPUT;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
480 if (! xft_draw)
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
481 abort ();
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
482 font_put_frame_data (f, &xftfont_driver, xft_draw);
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
483 }
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
484 return xft_draw;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
485 }
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
486
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
487 static int
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
488 xftfont_draw (s, from, to, x, y, with_background)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
489 struct glyph_string *s;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
490 int from, to, x, y, with_background;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
491 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
492 FRAME_PTR f = s->f;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
493 struct face *face = s->face;
91011
7239c19e55e9 (xftfont_draw): If s->font_info != s->face->font_info,
Kenichi Handa <handa@m17n.org>
parents: 90959
diff changeset
494 struct xftfont_info *xftfont_info = (struct xftfont_info *) s->font_info;
7239c19e55e9 (xftfont_draw): If s->font_info != s->face->font_info,
Kenichi Handa <handa@m17n.org>
parents: 90959
diff changeset
495 struct xftface_info *xftface_info = NULL;
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
496 XftDraw *xft_draw = xftfont_get_xft_draw (f);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
497 FT_UInt *code;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
498 XftColor fg, bg;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
499 XRectangle r;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
500 int len = to - from;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
501 int i;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
502
91011
7239c19e55e9 (xftfont_draw): If s->font_info != s->face->font_info,
Kenichi Handa <handa@m17n.org>
parents: 90959
diff changeset
503 if (s->font_info == face->font_info)
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
504 xftface_info = (struct xftface_info *) face->extra;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
505 xftfont_get_colors (f, face, s->gc, xftface_info,
90426
e9ed7d437c21 (xftfont_default_fid): Set fid_known to 1.
Kenichi Handa <handa@m17n.org>
parents: 90400
diff changeset
506 &fg, with_background ? &bg : NULL);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
507 BLOCK_INPUT;
91027
04b81a720da9 (xftfont_draw): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents: 91011
diff changeset
508 if (s->num_clips > 0)
04b81a720da9 (xftfont_draw): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents: 91011
diff changeset
509 XftDrawSetClipRectangles (xft_draw, 0, 0, s->clip, s->num_clips);
04b81a720da9 (xftfont_draw): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents: 91011
diff changeset
510 else
04b81a720da9 (xftfont_draw): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents: 91011
diff changeset
511 XftDrawSetClip (xft_draw, NULL);
04b81a720da9 (xftfont_draw): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents: 91011
diff changeset
512
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
513 if (with_background)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
514 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
515 struct font *font = (struct font *) face->font_info;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
516
91011
7239c19e55e9 (xftfont_draw): If s->font_info != s->face->font_info,
Kenichi Handa <handa@m17n.org>
parents: 90959
diff changeset
517 XftDrawRect (xft_draw, &bg,
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
518 x, y - face->font->ascent, s->width, font->font.height);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
519 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
520 code = alloca (sizeof (FT_UInt) * len);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
521 for (i = 0; i < len; i++)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
522 code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
523 | XCHAR2B_BYTE2 (s->char2b + from + i));
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
524
92184
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
525 if (s->padding_p)
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
526 for (i = 0; i < len; i++)
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
527 XftDrawGlyphs (xft_draw, &fg, xftfont_info->xftfont,
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
528 x + i, y, code + i, 1);
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
529 else
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
530 XftDrawGlyphs (xft_draw, &fg, xftfont_info->xftfont,
6218afb021ac (xftfont_draw): Pay attention to s->padding_p.
Kenichi Handa <handa@m17n.org>
parents: 91907
diff changeset
531 x, y, code, len);
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
532 UNBLOCK_INPUT;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
533
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
534 return len;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
535 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
536
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
537 static int
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
538 xftfont_anchor_point (font, code, index, x, y)
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
539 struct font *font;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
540 unsigned code;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
541 int index;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
542 int *x, *y;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
543 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
544 struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
545 FT_Face ft_face = XftLockFace (xftfont_info->xftfont);
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
546 int result;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
547
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
548 if (FT_Load_Glyph (ft_face, code, FT_LOAD_DEFAULT) != 0)
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
549 result = -1;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
550 else if (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
551 result = -1;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
552 else if (index >= ft_face->glyph->outline.n_points)
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
553 result = -1;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
554 else
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
555 {
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
556 *x = ft_face->glyph->outline.points[index].x;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
557 *y = ft_face->glyph->outline.points[index].y;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
558 }
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
559 XftUnlockFace (xftfont_info->xftfont);
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
560 return result;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
561 }
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
562
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
563 static int
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
564 xftfont_end_for_frame (f)
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
565 FRAME_PTR f;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
566 {
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
567 XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver);
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
568
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
569 if (xft_draw)
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
570 {
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
571 BLOCK_INPUT;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
572 XftDrawDestroy (xft_draw);
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
573 UNBLOCK_INPUT;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
574 font_put_frame_data (f, &xftfont_driver, NULL);
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
575 }
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
576 return 0;
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
577 }
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
578
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
579 #ifdef HAVE_LIBOTF
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
580 #ifdef HAVE_M17N_FLT
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
581 static Lisp_Object
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
582 xftfont_shape (lgstring)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
583 Lisp_Object lgstring;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
584 {
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
585 struct font *font;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
586 struct xftfont_info *xftfont_info;
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
587 int result;
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
588 FT_Face ft_face;
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
589
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
590 CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
591 xftfont_info = (struct xftfont_info *) font;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
592 if (! xftfont_info->maybe_otf)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
593 return Qnil;
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
594 ft_face = XftLockFace (xftfont_info->xftfont);
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
595 if (! xftfont_info->otf)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
596 {
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
597 OTF *otf = OTF_open_ft_face (ft_face);
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
598
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
599 if (! otf || OTF_get_table (otf, "head") < 0)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
600 {
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
601 if (otf)
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
602 OTF_close (otf);
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
603 xftfont_info->maybe_otf = 0;
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
604 XftUnlockFace (xftfont_info->xftfont);
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
605 return 0;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
606 }
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
607 xftfont_info->otf = otf;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
608 }
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
609
91226
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
610 result = ftfont_shape_by_flt (lgstring, font, ft_face, xftfont_info->otf);
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
611 XftUnlockFace (xftfont_info->xftfont);
040f2e332dc3 (struct xftfont_info): Delete the member ft_face.
Kenichi Handa <handa@m17n.org>
parents: 91163
diff changeset
612 return result;
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
613 }
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
614 #endif /* HAVE_M17N_FLT */
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
615 #endif /* HAVE_LIBOTF */
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
616
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
617 void
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
618 syms_of_xftfont ()
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
619 {
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
620 DEFSYM (Qxft, "xft");
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
621
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
622 xftfont_driver = ftfont_driver;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
623 xftfont_driver.type = Qxft;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
624 xftfont_driver.get_cache = xfont_driver.get_cache;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
625 xftfont_driver.list = xftfont_list;
90559
fb5d3ac2d786 (xftfont_match): New function.
Kenichi Handa <handa@m17n.org>
parents: 90527
diff changeset
626 xftfont_driver.match = xftfont_match;
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
627 xftfont_driver.open = xftfont_open;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
628 xftfont_driver.close = xftfont_close;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
629 xftfont_driver.prepare_face = xftfont_prepare_face;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
630 xftfont_driver.done_face = xftfont_done_face;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
631 xftfont_driver.encode_char = xftfont_encode_char;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
632 xftfont_driver.text_extents = xftfont_text_extents;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
633 xftfont_driver.draw = xftfont_draw;
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
634 xftfont_driver.anchor_point = xftfont_anchor_point;
91110
82a42637237c (struct xftface_info): Delete the member xft_draw.
Kenichi Handa <handa@m17n.org>
parents: 91027
diff changeset
635 xftfont_driver.end_for_frame = xftfont_end_for_frame;
91143
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
636 #ifdef HAVE_LIBOTF
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
637 #ifdef HAVE_M17N_FLT
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
638 xftfont_driver.shape = xftfont_shape;
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
639 #endif /* HAVE_M17N_FLT */
06de618f78e7 Include "ftfont.h".
Kenichi Handa <handa@m17n.org>
parents: 91110
diff changeset
640 #endif /* HAVE_LIBOTF */
90400
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
641
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
642 register_font_driver (&xftfont_driver, NULL);
80fff33f74f5 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
643 }
90427
ddb25860d044 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 90426
diff changeset
644
ddb25860d044 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 90426
diff changeset
645 /* arch-tag: 64ec61bf-7c8e-4fe6-b953-c6a85d5e1605
ddb25860d044 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 90426
diff changeset
646 (do not change this comment) */