diff options
| author | Jason Rumney | 2007-05-31 00:48:07 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-05-31 00:48:07 +0000 |
| commit | a1fe5c00611579c40e48c20eaf08360c4ed87a89 (patch) | |
| tree | 017c978d27afe1d3acf9fef22d5880657940588f /src | |
| parent | 4fe8e188b800f99d0eb0e1c3c3fab643d93d7898 (diff) | |
| download | emacs-a1fe5c00611579c40e48c20eaf08360c4ed87a89.tar.gz emacs-a1fe5c00611579c40e48c20eaf08360c4ed87a89.zip | |
[USE_FONT_BACKEND]: Port font backend changes from xfns.c.
(x_to_w32_charset, w32_to_x_charset): Expose externally.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 20442941668..62a97c96fdd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -57,6 +57,10 @@ Boston, MA 02110-1301, USA. */ | |||
| 57 | #include <dlgs.h> | 57 | #include <dlgs.h> |
| 58 | #define FILE_NAME_TEXT_FIELD edt1 | 58 | #define FILE_NAME_TEXT_FIELD edt1 |
| 59 | 59 | ||
| 60 | #ifdef USE_FONT_BACKEND | ||
| 61 | #include "font.h" | ||
| 62 | #endif | ||
| 63 | |||
| 60 | void syms_of_w32fns (); | 64 | void syms_of_w32fns (); |
| 61 | void globals_of_w32fns (); | 65 | void globals_of_w32fns (); |
| 62 | 66 | ||
| @@ -4129,6 +4133,38 @@ unwind_create_frame (frame) | |||
| 4129 | return Qnil; | 4133 | return Qnil; |
| 4130 | } | 4134 | } |
| 4131 | 4135 | ||
| 4136 | #ifdef USE_FONT_BACKEND | ||
| 4137 | static void | ||
| 4138 | x_default_font_parameter (f, parms) | ||
| 4139 | struct frame *f; | ||
| 4140 | Lisp_Object parms; | ||
| 4141 | { | ||
| 4142 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | ||
| 4143 | Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", | ||
| 4144 | RES_TYPE_STRING); | ||
| 4145 | |||
| 4146 | if (!STRINGP (font)) | ||
| 4147 | { | ||
| 4148 | int i; | ||
| 4149 | static char *names[] | ||
| 4150 | = { "-*-Courier New-normal-r-*-*-*-100-*-*-c-*-iso8859-1", | ||
| 4151 | "-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1", | ||
| 4152 | "-*-Fixedsys-normal-r-*-*-12-*-*-*-c-*-iso8859-1", | ||
| 4153 | "Fixedsys", | ||
| 4154 | NULL }; | ||
| 4155 | |||
| 4156 | for (i = 0; names[i]; i++) | ||
| 4157 | { | ||
| 4158 | font = font_open_by_name (f, names[i]); | ||
| 4159 | if (! NILP (font)) | ||
| 4160 | break; | ||
| 4161 | } | ||
| 4162 | if (NILP (font)) | ||
| 4163 | error ("No suitable font was found"); | ||
| 4164 | } | ||
| 4165 | x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); | ||
| 4166 | } | ||
| 4167 | #endif | ||
| 4132 | 4168 | ||
| 4133 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, | 4169 | DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
| 4134 | 1, 1, 0, | 4170 | 1, 1, 0, |
| @@ -4261,8 +4297,25 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4261 | specbind (Qx_resource_name, name); | 4297 | specbind (Qx_resource_name, name); |
| 4262 | } | 4298 | } |
| 4263 | 4299 | ||
| 4300 | #ifdef USE_FONT_BACKEND | ||
| 4301 | if (enable_font_backend) | ||
| 4302 | { | ||
| 4303 | /* Perhaps, we must allow frame parameter, say `font-backend', | ||
| 4304 | to specify which font backends to use. */ | ||
| 4305 | register_font_driver (&w32font_driver, f); | ||
| 4306 | |||
| 4307 | x_default_parameter (f, parameters, Qfont_backend, Qnil, | ||
| 4308 | "fontBackend", "FontBackend", RES_TYPE_STRING); | ||
| 4309 | } | ||
| 4310 | #endif /* USE_FONT_BACKEND */ | ||
| 4311 | |||
| 4264 | /* Extract the window parameters from the supplied values | 4312 | /* Extract the window parameters from the supplied values |
| 4265 | that are needed to determine window geometry. */ | 4313 | that are needed to determine window geometry. */ |
| 4314 | #ifdef USE_FONT_BACKEND | ||
| 4315 | if (enable_font_backend) | ||
| 4316 | x_default_font_parameter (f, parameters); | ||
| 4317 | else | ||
| 4318 | #endif | ||
| 4266 | { | 4319 | { |
| 4267 | Lisp_Object font; | 4320 | Lisp_Object font; |
| 4268 | 4321 | ||
| @@ -4852,7 +4905,7 @@ w32_to_x_weight (fnweight) | |||
| 4852 | return "*"; | 4905 | return "*"; |
| 4853 | } | 4906 | } |
| 4854 | 4907 | ||
| 4855 | static LONG | 4908 | LONG |
| 4856 | x_to_w32_charset (lpcs) | 4909 | x_to_w32_charset (lpcs) |
| 4857 | char * lpcs; | 4910 | char * lpcs; |
| 4858 | { | 4911 | { |
| @@ -4940,7 +4993,7 @@ x_to_w32_charset (lpcs) | |||
| 4940 | } | 4993 | } |
| 4941 | 4994 | ||
| 4942 | 4995 | ||
| 4943 | static char * | 4996 | char * |
| 4944 | w32_to_x_charset (fncharset, matching) | 4997 | w32_to_x_charset (fncharset, matching) |
| 4945 | int fncharset; | 4998 | int fncharset; |
| 4946 | char *matching; | 4999 | char *matching; |
| @@ -7339,8 +7392,25 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 7339 | specbind (Qx_resource_name, name); | 7392 | specbind (Qx_resource_name, name); |
| 7340 | } | 7393 | } |
| 7341 | 7394 | ||
| 7395 | #ifdef USE_FONT_BACKEND | ||
| 7396 | if (enable_font_backend) | ||
| 7397 | { | ||
| 7398 | /* Perhaps, we must allow frame parameter, say `font-backend', | ||
| 7399 | to specify which font backends to use. */ | ||
| 7400 | register_font_driver (&w32font_driver, f); | ||
| 7401 | |||
| 7402 | x_default_parameter (f, parms, Qfont_backend, Qnil, | ||
| 7403 | "fontBackend", "FontBackend", RES_TYPE_STRING); | ||
| 7404 | } | ||
| 7405 | #endif /* USE_FONT_BACKEND */ | ||
| 7406 | |||
| 7342 | /* Extract the window parameters from the supplied values | 7407 | /* Extract the window parameters from the supplied values |
| 7343 | that are needed to determine window geometry. */ | 7408 | that are needed to determine window geometry. */ |
| 7409 | #ifdef USE_FONT_BACKEND | ||
| 7410 | if (enable_font_backend) | ||
| 7411 | x_default_font_parameter (f, parms); | ||
| 7412 | else | ||
| 7413 | #endif /* USE_FONT_BACKEND */ | ||
| 7344 | { | 7414 | { |
| 7345 | Lisp_Object font; | 7415 | Lisp_Object font; |
| 7346 | 7416 | ||
| @@ -8655,6 +8725,9 @@ frame_parm_handler w32_frame_parm_handlers[] = | |||
| 8655 | x_set_fringe_width, | 8725 | x_set_fringe_width, |
| 8656 | 0, /* x_set_wait_for_wm, */ | 8726 | 0, /* x_set_wait_for_wm, */ |
| 8657 | x_set_fullscreen, | 8727 | x_set_fullscreen, |
| 8728 | #ifdef USE_FONT_BACKEND | ||
| 8729 | x_set_font_backend | ||
| 8730 | #endif | ||
| 8658 | }; | 8731 | }; |
| 8659 | 8732 | ||
| 8660 | void | 8733 | void |