diff options
| author | Kenichi Handa | 2009-03-11 11:44:21 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-03-11 11:44:21 +0000 |
| commit | c50b7e98eae199d032b24115ae98a520b7b1cda4 (patch) | |
| tree | 2573e48999e211664be775b6ba828a2baa525d72 /src | |
| parent | fb9306765f25aabd7b6c5638f548e9922d5b643a (diff) | |
| download | emacs-c50b7e98eae199d032b24115ae98a520b7b1cda4.tar.gz emacs-c50b7e98eae199d032b24115ae98a520b7b1cda4.zip | |
(font_open_by_spec): New function.
(font_open_by_name): Use font_open_by_spec.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/font.c | 32 |
2 files changed, 26 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 331d06fdccf..036d540a015 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-03-11 Kenichi Handa <handa@m17n.org> | 1 | 2009-03-11 Kenichi Handa <handa@m17n.org> |
| 2 | 2 | ||
| 3 | * font.c (font_open_by_spec): New function. | ||
| 4 | (font_open_by_name): Use font_open_by_spec. | ||
| 5 | |||
| 3 | * frame.c (x_set_font): When ARG is a font-object, don't alter the | 6 | * frame.c (x_set_font): When ARG is a font-object, don't alter the |
| 4 | fontset of the frame. | 7 | fontset of the frame. |
| 5 | 8 | ||
diff --git a/src/font.c b/src/font.c index 9a656b1c6fe..5ad6d0bf8f0 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -3484,20 +3484,16 @@ font_done_for_face (f, face) | |||
| 3484 | } | 3484 | } |
| 3485 | 3485 | ||
| 3486 | 3486 | ||
| 3487 | /* Open a font best matching with NAME on frame F. If no proper font | 3487 | /* Open a font matching with font-spec SPEC on frame F. If no proper |
| 3488 | is found, return Qnil. */ | 3488 | font is found, return Qnil. */ |
| 3489 | 3489 | ||
| 3490 | Lisp_Object | 3490 | Lisp_Object |
| 3491 | font_open_by_name (f, name) | 3491 | font_open_by_spec (f, spec) |
| 3492 | FRAME_PTR f; | 3492 | FRAME_PTR f; |
| 3493 | char *name; | 3493 | Lisp_Object spec; |
| 3494 | { | 3494 | { |
| 3495 | Lisp_Object args[2]; | 3495 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 3496 | Lisp_Object spec, attrs[LFACE_VECTOR_SIZE]; | ||
| 3497 | 3496 | ||
| 3498 | args[0] = QCname; | ||
| 3499 | args[1] = make_unibyte_string (name, strlen (name)); | ||
| 3500 | spec = Ffont_spec (2, args); | ||
| 3501 | /* We set up the default font-related attributes of a face to prefer | 3497 | /* We set up the default font-related attributes of a face to prefer |
| 3502 | a moderate font. */ | 3498 | a moderate font. */ |
| 3503 | attrs[LFACE_FAMILY_INDEX] = attrs[LFACE_FOUNDRY_INDEX] = Qnil; | 3499 | attrs[LFACE_FAMILY_INDEX] = attrs[LFACE_FOUNDRY_INDEX] = Qnil; |
| @@ -3514,6 +3510,24 @@ font_open_by_name (f, name) | |||
| 3514 | } | 3510 | } |
| 3515 | 3511 | ||
| 3516 | 3512 | ||
| 3513 | /* Open a font matching with NAME on frame F. If no proper font is | ||
| 3514 | found, return Qnil. */ | ||
| 3515 | |||
| 3516 | Lisp_Object | ||
| 3517 | font_open_by_name (f, name) | ||
| 3518 | FRAME_PTR f; | ||
| 3519 | char *name; | ||
| 3520 | { | ||
| 3521 | Lisp_Object args[2]; | ||
| 3522 | Lisp_Object spec; | ||
| 3523 | |||
| 3524 | args[0] = QCname; | ||
| 3525 | args[1] = make_unibyte_string (name, strlen (name)); | ||
| 3526 | spec = Ffont_spec (2, args); | ||
| 3527 | return font_open_by_spec (f, spec); | ||
| 3528 | } | ||
| 3529 | |||
| 3530 | |||
| 3517 | /* Register font-driver DRIVER. This function is used in two ways. | 3531 | /* Register font-driver DRIVER. This function is used in two ways. |
| 3518 | 3532 | ||
| 3519 | The first is with frame F non-NULL. In this case, make DRIVER | 3533 | The first is with frame F non-NULL. In this case, make DRIVER |