Mercurial > emacs
comparison src/xftfont.c @ 109234:810852b2385b
Merge from mainline.
author | Katsumi Yamaoka <katsumi@flagship2> |
---|---|
date | Sat, 03 Jul 2010 11:08:43 +0000 |
parents | 2bc9a0c04c87 |
children | aec1143e8d85 |
comparison
equal
deleted
inserted
replaced
109233:9f1761f40039 | 109234:810852b2385b |
---|---|
68 { | 68 { |
69 XftColor xft_fg; /* color for face->foreground */ | 69 XftColor xft_fg; /* color for face->foreground */ |
70 XftColor xft_bg; /* color for face->background */ | 70 XftColor xft_bg; /* color for face->background */ |
71 }; | 71 }; |
72 | 72 |
73 static void xftfont_get_colors P_ ((FRAME_PTR, struct face *, GC gc, | 73 static void xftfont_get_colors (FRAME_PTR, struct face *, GC gc, |
74 struct xftface_info *, | 74 struct xftface_info *, |
75 XftColor *fg, XftColor *bg)); | 75 XftColor *fg, XftColor *bg); |
76 | 76 |
77 | 77 |
78 /* Setup foreground and background colors of GC into FG and BG. If | 78 /* Setup foreground and background colors of GC into FG and BG. If |
79 XFTFACE_INFO is not NULL, reuse the colors in it if possible. BG | 79 XFTFACE_INFO is not NULL, reuse the colors in it if possible. BG |
80 may be NULL. */ | 80 may be NULL. */ |
139 UNBLOCK_INPUT; | 139 UNBLOCK_INPUT; |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 static Lisp_Object xftfont_list P_ ((Lisp_Object, Lisp_Object)); | 144 static Lisp_Object xftfont_list (Lisp_Object, Lisp_Object); |
145 static Lisp_Object xftfont_match P_ ((Lisp_Object, Lisp_Object)); | 145 static Lisp_Object xftfont_match (Lisp_Object, Lisp_Object); |
146 static Lisp_Object xftfont_open P_ ((FRAME_PTR, Lisp_Object, int)); | 146 static Lisp_Object xftfont_open (FRAME_PTR, Lisp_Object, int); |
147 static void xftfont_close P_ ((FRAME_PTR, struct font *)); | 147 static void xftfont_close (FRAME_PTR, struct font *); |
148 static int xftfont_prepare_face P_ ((FRAME_PTR, struct face *)); | 148 static int xftfont_prepare_face (FRAME_PTR, struct face *); |
149 static void xftfont_done_face P_ ((FRAME_PTR, struct face *)); | 149 static void xftfont_done_face (FRAME_PTR, struct face *); |
150 static int xftfont_has_char P_ ((Lisp_Object, int)); | 150 static int xftfont_has_char (Lisp_Object, int); |
151 static unsigned xftfont_encode_char P_ ((struct font *, int)); | 151 static unsigned xftfont_encode_char (struct font *, int); |
152 static int xftfont_text_extents P_ ((struct font *, unsigned *, int, | 152 static int xftfont_text_extents (struct font *, unsigned *, int, |
153 struct font_metrics *)); | 153 struct font_metrics *); |
154 static int xftfont_draw P_ ((struct glyph_string *, int, int, int, int, int)); | 154 static int xftfont_draw (struct glyph_string *, int, int, int, int, int); |
155 static int xftfont_end_for_frame P_ ((FRAME_PTR f)); | 155 static int xftfont_end_for_frame (FRAME_PTR f); |
156 | 156 |
157 struct font_driver xftfont_driver; | 157 struct font_driver xftfont_driver; |
158 | 158 |
159 static Lisp_Object | 159 static Lisp_Object |
160 xftfont_list (frame, spec) | 160 xftfont_list (frame, spec) |
178 if (! NILP (entity)) | 178 if (! NILP (entity)) |
179 ASET (entity, FONT_TYPE_INDEX, Qxft); | 179 ASET (entity, FONT_TYPE_INDEX, Qxft); |
180 return entity; | 180 return entity; |
181 } | 181 } |
182 | 182 |
183 extern Lisp_Object ftfont_font_format P_ ((FcPattern *, Lisp_Object)); | 183 extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object); |
184 extern FcCharSet *ftfont_get_fc_charset P_ ((Lisp_Object)); | 184 extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); |
185 extern Lisp_Object QCantialias; | 185 extern Lisp_Object QCantialias; |
186 | 186 |
187 static FcChar8 ascii_printable[95]; | 187 static FcChar8 ascii_printable[95]; |
188 | 188 |
189 static void | 189 static void |
427 int i; | 427 int i; |
428 for (i = 0; i < 95; i++) | 428 for (i = 0; i < 95; i++) |
429 ascii_printable[i] = ' ' + i; | 429 ascii_printable[i] = ' ' + i; |
430 } | 430 } |
431 BLOCK_INPUT; | 431 BLOCK_INPUT; |
432 if (spacing != FC_PROPORTIONAL) | 432 if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL) |
433 { | 433 { |
434 font->min_width = font->average_width = font->space_width | 434 font->min_width = font->average_width = font->space_width |
435 = xftfont->max_advance_width; | 435 = xftfont->max_advance_width; |
436 XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents); | 436 XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents); |
437 } | 437 } |