diff options
| -rw-r--r-- | src/font.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/font.c b/src/font.c index 1e95315bdaf..b911ac13030 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2603,8 +2603,8 @@ font_find_for_lface (f, lface, spec, c) | |||
| 2603 | Lisp_Object spec; | 2603 | Lisp_Object spec; |
| 2604 | int c; | 2604 | int c; |
| 2605 | { | 2605 | { |
| 2606 | Lisp_Object frame, entities; | 2606 | Lisp_Object frame, entities, val; |
| 2607 | int i; | 2607 | int i, result; |
| 2608 | 2608 | ||
| 2609 | XSETFRAME (frame, f); | 2609 | XSETFRAME (frame, f); |
| 2610 | 2610 | ||
| @@ -2646,9 +2646,9 @@ font_find_for_lface (f, lface, spec, c) | |||
| 2646 | 2646 | ||
| 2647 | if (c >= 0) | 2647 | if (c >= 0) |
| 2648 | { | 2648 | { |
| 2649 | struct charset *repertory; | 2649 | struct charset *encoding, *repertory; |
| 2650 | 2650 | ||
| 2651 | if (font_registry_charsets (registry, NULL, &repertory) < 0) | 2651 | if (font_registry_charsets (registry, &encoding, &repertory) < 0) |
| 2652 | return Qnil; | 2652 | return Qnil; |
| 2653 | if (repertory) | 2653 | if (repertory) |
| 2654 | { | 2654 | { |
| @@ -2659,7 +2659,7 @@ font_find_for_lface (f, lface, spec, c) | |||
| 2659 | suppress the further checking. */ | 2659 | suppress the further checking. */ |
| 2660 | c = -1; | 2660 | c = -1; |
| 2661 | } | 2661 | } |
| 2662 | else if (c > MAX_UNICODE_CHAR) | 2662 | else if (c > encoding->max_char) |
| 2663 | return Qnil; | 2663 | return Qnil; |
| 2664 | } | 2664 | } |
| 2665 | for (i = 0; i < FONT_SPEC_MAX; i++) | 2665 | for (i = 0; i < FONT_SPEC_MAX; i++) |
| @@ -2692,23 +2692,19 @@ font_find_for_lface (f, lface, spec, c) | |||
| 2692 | 2692 | ||
| 2693 | if (c < 0) | 2693 | if (c < 0) |
| 2694 | return AREF (entities, 0); | 2694 | return AREF (entities, 0); |
| 2695 | for (i = 0; i < ASIZE (entities); i++) | ||
| 2696 | { | ||
| 2697 | int result = font_has_char (f, AREF (entities, i), c); | ||
| 2698 | Lisp_Object font_object; | ||
| 2699 | 2695 | ||
| 2700 | if (result > 0) | 2696 | val = AREF (entities, 0); |
| 2701 | return AREF (entities, i); | 2697 | result = font_has_char (f, val, c); |
| 2702 | if (result == 0) | 2698 | if (result > 0) |
| 2703 | continue; | 2699 | return val; |
| 2704 | font_object = font_open_for_lface (f, AREF (entities, i), lface, spec); | 2700 | if (result == 0) |
| 2705 | if (NILP (font_object)) | 2701 | return Qnil; |
| 2706 | continue; | 2702 | val = font_open_for_lface (f, val, lface, spec); |
| 2707 | result = font_has_char (f, font_object, c); | 2703 | if (NILP (val)) |
| 2708 | font_close_object (f, font_object); | 2704 | return Qnil; |
| 2709 | if (result > 0) | 2705 | result = font_has_char (f, val, c); |
| 2710 | return AREF (entities, i); | 2706 | if (result > 0) |
| 2711 | } | 2707 | return val; |
| 2712 | return Qnil; | 2708 | return Qnil; |
| 2713 | } | 2709 | } |
| 2714 | 2710 | ||
| @@ -3101,7 +3097,7 @@ font_at (c, pos, face, w, string) | |||
| 3101 | /* Lisp API */ | 3097 | /* Lisp API */ |
| 3102 | 3098 | ||
| 3103 | DEFUN ("fontp", Ffontp, Sfontp, 1, 1, 0, | 3099 | DEFUN ("fontp", Ffontp, Sfontp, 1, 1, 0, |
| 3104 | doc: /* Return t if OBJECT is a font-spec or font-entity. | 3100 | doc: /* Return t if OBJECT is a font-spec, font-entity, or font-object. |
| 3105 | Return nil otherwise. */) | 3101 | Return nil otherwise. */) |
| 3106 | (object) | 3102 | (object) |
| 3107 | Lisp_Object object; | 3103 | Lisp_Object object; |