diff options
Diffstat (limited to 'src/font.c')
| -rw-r--r-- | src/font.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/font.c b/src/font.c index f7cebdce78c..441652b0951 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -3794,19 +3794,26 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, | |||
| 3794 | int c; | 3794 | int c; |
| 3795 | Lisp_Object font_object = Qnil; | 3795 | Lisp_Object font_object = Qnil; |
| 3796 | 3796 | ||
| 3797 | if (NILP (string)) | 3797 | if (!face) |
| 3798 | { | 3798 | { |
| 3799 | if (! face) | 3799 | struct frame *f = XFRAME (w->frame); |
| 3800 | int face_id; | ||
| 3801 | |||
| 3802 | if (NILP (string)) | ||
| 3803 | face_id = face_at_buffer_position (w, pos, &ignore, *limit, | ||
| 3804 | false, -1); | ||
| 3805 | else | ||
| 3800 | { | 3806 | { |
| 3801 | int face_id; | 3807 | face_id = |
| 3808 | NILP (Vface_remapping_alist) | ||
| 3809 | ? DEFAULT_FACE_ID | ||
| 3810 | : lookup_basic_face (f, DEFAULT_FACE_ID); | ||
| 3802 | 3811 | ||
| 3803 | face_id = face_at_buffer_position (w, pos, &ignore, | 3812 | face_id = face_at_string_position (w, string, pos, 0, &ignore, |
| 3804 | *limit, false, -1); | 3813 | face_id, false); |
| 3805 | face = FACE_FROM_ID (XFRAME (w->frame), face_id); | ||
| 3806 | } | 3814 | } |
| 3815 | face = FACE_FROM_ID (f, face_id); | ||
| 3807 | } | 3816 | } |
| 3808 | else | ||
| 3809 | eassert (face); | ||
| 3810 | 3817 | ||
| 3811 | while (pos < *limit) | 3818 | while (pos < *limit) |
| 3812 | { | 3819 | { |