diff options
Diffstat (limited to 'src/font.c')
| -rw-r--r-- | src/font.c | 109 |
1 files changed, 57 insertions, 52 deletions
diff --git a/src/font.c b/src/font.c index 41dbfd7a757..d66620bffbc 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* font.c -- "Font" primitives. | 1 | /* font.c -- "Font" primitives. |
| 2 | 2 | ||
| 3 | Copyright (C) 2006-2012 Free Software Foundation, Inc. | 3 | Copyright (C) 2006-2013 Free Software Foundation, Inc. |
| 4 | Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 | 4 | Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 |
| 5 | National Institute of Advanced Industrial Science and Technology (AIST) | 5 | National Institute of Advanced Industrial Science and Technology (AIST) |
| 6 | Registration Number H13PRO009 | 6 | Registration Number H13PRO009 |
| @@ -229,7 +229,7 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) | |||
| 229 | 229 | ||
| 230 | if (len == 1 && *str == '*') | 230 | if (len == 1 && *str == '*') |
| 231 | return Qnil; | 231 | return Qnil; |
| 232 | if (!force_symbol && 0 < len && '0' <= *str && *str <= '9') | 232 | if (!force_symbol && len > 0 && '0' <= *str && *str <= '9') |
| 233 | { | 233 | { |
| 234 | for (i = 1; i < len; i++) | 234 | for (i = 1; i < len; i++) |
| 235 | if (! ('0' <= str[i] && str[i] <= '9')) | 235 | if (! ('0' <= str[i] && str[i] <= '9')) |
| @@ -243,7 +243,7 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) | |||
| 243 | { | 243 | { |
| 244 | if (i == len) | 244 | if (i == len) |
| 245 | return make_number (n); | 245 | return make_number (n); |
| 246 | if (MOST_POSITIVE_FIXNUM / 10 < n) | 246 | if (n > MOST_POSITIVE_FIXNUM / 10) |
| 247 | break; | 247 | break; |
| 248 | } | 248 | } |
| 249 | 249 | ||
| @@ -287,7 +287,7 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec) | |||
| 287 | if (INTEGERP (val)) | 287 | if (INTEGERP (val)) |
| 288 | dpi = XINT (val); | 288 | dpi = XINT (val); |
| 289 | else | 289 | else |
| 290 | dpi = f->resy; | 290 | dpi = FRAME_RES_Y (f); |
| 291 | pixel_size = POINT_TO_PIXEL (point_size, dpi); | 291 | pixel_size = POINT_TO_PIXEL (point_size, dpi); |
| 292 | return pixel_size; | 292 | return pixel_size; |
| 293 | #else | 293 | #else |
| @@ -717,7 +717,7 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) | |||
| 717 | } | 717 | } |
| 718 | 718 | ||
| 719 | 719 | ||
| 720 | /* Font name parser and unparser */ | 720 | /* Font name parser and unparser. */ |
| 721 | 721 | ||
| 722 | static int parse_matrix (const char *); | 722 | static int parse_matrix (const char *); |
| 723 | static int font_expand_wildcards (Lisp_Object *, int); | 723 | static int font_expand_wildcards (Lisp_Object *, int); |
| @@ -1234,8 +1234,21 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes) | |||
| 1234 | f[j] = "*"; | 1234 | f[j] = "*"; |
| 1235 | else | 1235 | else |
| 1236 | { | 1236 | { |
| 1237 | int c, k, l; | ||
| 1238 | ptrdiff_t alloc; | ||
| 1239 | |||
| 1237 | val = SYMBOL_NAME (val); | 1240 | val = SYMBOL_NAME (val); |
| 1238 | f[j] = SSDATA (val); | 1241 | alloc = SBYTES (val) + 1; |
| 1242 | if (nbytes <= alloc) | ||
| 1243 | return -1; | ||
| 1244 | f[j] = p = alloca (alloc); | ||
| 1245 | /* Copy the name while excluding '-', '?', ',', and '"'. */ | ||
| 1246 | for (k = l = 0; k < alloc; k++) | ||
| 1247 | { | ||
| 1248 | c = SREF (val, k); | ||
| 1249 | if (c != '-' && c != '?' && c != ',' && c != '"') | ||
| 1250 | p[l++] = c; | ||
| 1251 | } | ||
| 1239 | } | 1252 | } |
| 1240 | } | 1253 | } |
| 1241 | 1254 | ||
| @@ -1733,7 +1746,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec | |||
| 1733 | /* This part (through the next ^L) is still experimental and not | 1746 | /* This part (through the next ^L) is still experimental and not |
| 1734 | tested much. We may drastically change codes. */ | 1747 | tested much. We may drastically change codes. */ |
| 1735 | 1748 | ||
| 1736 | /* OTF handler */ | 1749 | /* OTF handler. */ |
| 1737 | 1750 | ||
| 1738 | #if 0 | 1751 | #if 0 |
| 1739 | 1752 | ||
| @@ -1844,11 +1857,11 @@ otf_open (Lisp_Object file) | |||
| 1844 | OTF *otf; | 1857 | OTF *otf; |
| 1845 | 1858 | ||
| 1846 | if (! NILP (val)) | 1859 | if (! NILP (val)) |
| 1847 | otf = XSAVE_VALUE (XCDR (val))->pointer; | 1860 | otf = XSAVE_POINTER (XCDR (val), 0); |
| 1848 | else | 1861 | else |
| 1849 | { | 1862 | { |
| 1850 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; | 1863 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; |
| 1851 | val = make_save_value (otf, 0); | 1864 | val = make_save_pointer (otf); |
| 1852 | otf_list = Fcons (Fcons (file, val), otf_list); | 1865 | otf_list = Fcons (Fcons (file, val), otf_list); |
| 1853 | } | 1866 | } |
| 1854 | return otf; | 1867 | return otf; |
| @@ -2022,7 +2035,7 @@ font_otf_Anchor (OTF_Anchor *anchor) | |||
| 2022 | #endif /* 0 */ | 2035 | #endif /* 0 */ |
| 2023 | 2036 | ||
| 2024 | 2037 | ||
| 2025 | /* Font sorting */ | 2038 | /* Font sorting. */ |
| 2026 | 2039 | ||
| 2027 | static unsigned font_score (Lisp_Object, Lisp_Object *); | 2040 | static unsigned font_score (Lisp_Object, Lisp_Object *); |
| 2028 | static int font_compare (const void *, const void *); | 2041 | static int font_compare (const void *, const void *); |
| @@ -2088,9 +2101,7 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop) | |||
| 2088 | { | 2101 | { |
| 2089 | EMACS_INT diff = ((XINT (AREF (entity, i)) >> 8) | 2102 | EMACS_INT diff = ((XINT (AREF (entity, i)) >> 8) |
| 2090 | - (XINT (spec_prop[i]) >> 8)); | 2103 | - (XINT (spec_prop[i]) >> 8)); |
| 2091 | if (diff < 0) | 2104 | score |= min (eabs (diff), 127) << sort_shift_bits[i]; |
| 2092 | diff = - diff; | ||
| 2093 | score |= min (diff, 127) << sort_shift_bits[i]; | ||
| 2094 | } | 2105 | } |
| 2095 | 2106 | ||
| 2096 | /* Score the size. Maximum difference is 127. */ | 2107 | /* Score the size. Maximum difference is 127. */ |
| @@ -2105,10 +2116,7 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop) | |||
| 2105 | 2116 | ||
| 2106 | if (CONSP (Vface_font_rescale_alist)) | 2117 | if (CONSP (Vface_font_rescale_alist)) |
| 2107 | pixel_size *= font_rescale_ratio (entity); | 2118 | pixel_size *= font_rescale_ratio (entity); |
| 2108 | diff = pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX)); | 2119 | diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1; |
| 2109 | if (diff < 0) | ||
| 2110 | diff = - diff; | ||
| 2111 | diff <<= 1; | ||
| 2112 | if (! NILP (spec_prop[FONT_DPI_INDEX]) | 2120 | if (! NILP (spec_prop[FONT_DPI_INDEX]) |
| 2113 | && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX))) | 2121 | && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX))) |
| 2114 | diff |= 1; | 2122 | diff |= 1; |
| @@ -2557,7 +2565,6 @@ font_get_cache (FRAME_PTR f, struct font_driver *driver) | |||
| 2557 | return val; | 2565 | return val; |
| 2558 | } | 2566 | } |
| 2559 | 2567 | ||
| 2560 | static int num_fonts; | ||
| 2561 | 2568 | ||
| 2562 | static void | 2569 | static void |
| 2563 | font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) | 2570 | font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) |
| @@ -2590,7 +2597,6 @@ font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) | |||
| 2590 | { | 2597 | { |
| 2591 | eassert (font && driver == font->driver); | 2598 | eassert (font && driver == font->driver); |
| 2592 | driver->close (f, font); | 2599 | driver->close (f, font); |
| 2593 | num_fonts--; | ||
| 2594 | } | 2600 | } |
| 2595 | } | 2601 | } |
| 2596 | if (driver->free_entity) | 2602 | if (driver->free_entity) |
| @@ -2658,9 +2664,7 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) | |||
| 2658 | { | 2664 | { |
| 2659 | int diff = XINT (AREF (entity, FONT_SIZE_INDEX)) - size; | 2665 | int diff = XINT (AREF (entity, FONT_SIZE_INDEX)) - size; |
| 2660 | 2666 | ||
| 2661 | if (diff != 0 | 2667 | if (eabs (diff) > FONT_PIXEL_SIZE_QUANTUM) |
| 2662 | && (diff < 0 ? -diff > FONT_PIXEL_SIZE_QUANTUM | ||
| 2663 | : diff > FONT_PIXEL_SIZE_QUANTUM)) | ||
| 2664 | prop = FONT_SPEC_MAX; | 2668 | prop = FONT_SPEC_MAX; |
| 2665 | } | 2669 | } |
| 2666 | if (prop < FONT_SPEC_MAX | 2670 | if (prop < FONT_SPEC_MAX |
| @@ -2850,7 +2854,6 @@ font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size) | |||
| 2850 | return Qnil; | 2854 | return Qnil; |
| 2851 | ASET (entity, FONT_OBJLIST_INDEX, | 2855 | ASET (entity, FONT_OBJLIST_INDEX, |
| 2852 | Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); | 2856 | Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); |
| 2853 | num_fonts++; | ||
| 2854 | 2857 | ||
| 2855 | font = XFONT_OBJECT (font_object); | 2858 | font = XFONT_OBJECT (font_object); |
| 2856 | min_width = (font->min_width ? font->min_width | 2859 | min_width = (font->min_width ? font->min_width |
| @@ -2895,7 +2898,6 @@ font_close_object (FRAME_PTR f, Lisp_Object font_object) | |||
| 2895 | eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts); | 2898 | eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts); |
| 2896 | FRAME_X_DISPLAY_INFO (f)->n_fonts--; | 2899 | FRAME_X_DISPLAY_INFO (f)->n_fonts--; |
| 2897 | #endif | 2900 | #endif |
| 2898 | num_fonts--; | ||
| 2899 | } | 2901 | } |
| 2900 | 2902 | ||
| 2901 | 2903 | ||
| @@ -3115,7 +3117,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c) | |||
| 3115 | { | 3117 | { |
| 3116 | double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); | 3118 | double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); |
| 3117 | 3119 | ||
| 3118 | pixel_size = POINT_TO_PIXEL (pt / 10, f->resy); | 3120 | pixel_size = POINT_TO_PIXEL (pt / 10, FRAME_RES_Y (f)); |
| 3119 | } | 3121 | } |
| 3120 | ASET (work, FONT_SIZE_INDEX, Qnil); | 3122 | ASET (work, FONT_SIZE_INDEX, Qnil); |
| 3121 | foundry[0] = AREF (work, FONT_FOUNDRY_INDEX); | 3123 | foundry[0] = AREF (work, FONT_FOUNDRY_INDEX); |
| @@ -3245,12 +3247,13 @@ font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_O | |||
| 3245 | } | 3247 | } |
| 3246 | 3248 | ||
| 3247 | pt /= 10; | 3249 | pt /= 10; |
| 3248 | size = POINT_TO_PIXEL (pt, f->resy); | 3250 | size = POINT_TO_PIXEL (pt, FRAME_RES_Y (f)); |
| 3249 | #ifdef HAVE_NS | 3251 | #ifdef HAVE_NS |
| 3250 | if (size == 0) | 3252 | if (size == 0) |
| 3251 | { | 3253 | { |
| 3252 | Lisp_Object ffsize = get_frame_param (f, Qfontsize); | 3254 | Lisp_Object ffsize = get_frame_param (f, Qfontsize); |
| 3253 | size = NUMBERP (ffsize) ? POINT_TO_PIXEL (XINT (ffsize), f->resy) : 0; | 3255 | size = (NUMBERP (ffsize) |
| 3256 | ? POINT_TO_PIXEL (XINT (ffsize), FRAME_RES_Y (f)) : 0); | ||
| 3254 | } | 3257 | } |
| 3255 | #endif | 3258 | #endif |
| 3256 | } | 3259 | } |
| @@ -3572,7 +3575,7 @@ font_filter_properties (Lisp_Object font, | |||
| 3572 | Lisp_Object it; | 3575 | Lisp_Object it; |
| 3573 | int i; | 3576 | int i; |
| 3574 | 3577 | ||
| 3575 | /* Set boolean values to Qt or Qnil */ | 3578 | /* Set boolean values to Qt or Qnil. */ |
| 3576 | for (i = 0; boolean_properties[i] != NULL; ++i) | 3579 | for (i = 0; boolean_properties[i] != NULL; ++i) |
| 3577 | for (it = alist; ! NILP (it); it = XCDR (it)) | 3580 | for (it = alist; ! NILP (it); it = XCDR (it)) |
| 3578 | { | 3581 | { |
| @@ -3687,11 +3690,11 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, | |||
| 3687 | 3690 | ||
| 3688 | #ifdef HAVE_WINDOW_SYSTEM | 3691 | #ifdef HAVE_WINDOW_SYSTEM |
| 3689 | 3692 | ||
| 3690 | /* Check how many characters after POS (at most to *LIMIT) can be | 3693 | /* Check how many characters after character/byte position POS/POS_BYTE |
| 3691 | displayed by the same font in the window W. FACE, if non-NULL, is | 3694 | (at most to *LIMIT) can be displayed by the same font in the window W. |
| 3692 | the face selected for the character at POS. If STRING is not nil, | 3695 | FACE, if non-NULL, is the face selected for the character at POS. |
| 3693 | it is the string to check instead of the current buffer. In that | 3696 | If STRING is not nil, it is the string to check instead of the current |
| 3694 | case, FACE must be not NULL. | 3697 | buffer. In that case, FACE must be not NULL. |
| 3695 | 3698 | ||
| 3696 | The return value is the font-object for the character at POS. | 3699 | The return value is the font-object for the character at POS. |
| 3697 | *LIMIT is set to the position where that font can't be used. | 3700 | *LIMIT is set to the position where that font can't be used. |
| @@ -3699,15 +3702,15 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, | |||
| 3699 | It is assured that the current buffer (or STRING) is multibyte. */ | 3702 | It is assured that the current buffer (or STRING) is multibyte. */ |
| 3700 | 3703 | ||
| 3701 | Lisp_Object | 3704 | Lisp_Object |
| 3702 | font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face, Lisp_Object string) | 3705 | font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, |
| 3706 | struct window *w, struct face *face, Lisp_Object string) | ||
| 3703 | { | 3707 | { |
| 3704 | ptrdiff_t pos_byte, ignore; | 3708 | ptrdiff_t ignore; |
| 3705 | int c; | 3709 | int c; |
| 3706 | Lisp_Object font_object = Qnil; | 3710 | Lisp_Object font_object = Qnil; |
| 3707 | 3711 | ||
| 3708 | if (NILP (string)) | 3712 | if (NILP (string)) |
| 3709 | { | 3713 | { |
| 3710 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 3711 | if (! face) | 3714 | if (! face) |
| 3712 | { | 3715 | { |
| 3713 | int face_id; | 3716 | int face_id; |
| @@ -3718,10 +3721,7 @@ font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face | |||
| 3718 | } | 3721 | } |
| 3719 | } | 3722 | } |
| 3720 | else | 3723 | else |
| 3721 | { | 3724 | eassert (face); |
| 3722 | eassert (face); | ||
| 3723 | pos_byte = string_char_to_byte (string, pos); | ||
| 3724 | } | ||
| 3725 | 3725 | ||
| 3726 | while (pos < *limit) | 3726 | while (pos < *limit) |
| 3727 | { | 3727 | { |
| @@ -3751,7 +3751,7 @@ font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face | |||
| 3751 | #endif | 3751 | #endif |
| 3752 | 3752 | ||
| 3753 | 3753 | ||
| 3754 | /* Lisp API */ | 3754 | /* Lisp API. */ |
| 3755 | 3755 | ||
| 3756 | DEFUN ("fontp", Ffontp, Sfontp, 1, 2, 0, | 3756 | DEFUN ("fontp", Ffontp, Sfontp, 1, 2, 0, |
| 3757 | doc: /* Return t if OBJECT is a font-spec, font-entity, or font-object. | 3757 | doc: /* Return t if OBJECT is a font-spec, font-entity, or font-object. |
| @@ -4022,7 +4022,7 @@ are to be displayed on. If omitted, the selected frame is used. */) | |||
| 4022 | if (INTEGERP (val)) | 4022 | if (INTEGERP (val)) |
| 4023 | { | 4023 | { |
| 4024 | Lisp_Object font_dpi = AREF (font, FONT_DPI_INDEX); | 4024 | Lisp_Object font_dpi = AREF (font, FONT_DPI_INDEX); |
| 4025 | int dpi = INTEGERP (font_dpi) ? XINT (font_dpi) : f->resy; | 4025 | int dpi = INTEGERP (font_dpi) ? XINT (font_dpi) : FRAME_RES_Y (f); |
| 4026 | plist[n++] = QCheight; | 4026 | plist[n++] = QCheight; |
| 4027 | plist[n++] = make_number (PIXEL_TO_POINT (XINT (val) * 10, dpi)); | 4027 | plist[n++] = make_number (PIXEL_TO_POINT (XINT (val) * 10, dpi)); |
| 4028 | } | 4028 | } |
| @@ -4533,7 +4533,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0, | |||
| 4533 | { | 4533 | { |
| 4534 | CHECK_NUMBER_OR_FLOAT (size); | 4534 | CHECK_NUMBER_OR_FLOAT (size); |
| 4535 | if (FLOATP (size)) | 4535 | if (FLOATP (size)) |
| 4536 | isize = POINT_TO_PIXEL (XFLOAT_DATA (size), f->resy); | 4536 | isize = POINT_TO_PIXEL (XFLOAT_DATA (size), FRAME_RES_Y (f)); |
| 4537 | else | 4537 | else |
| 4538 | isize = XINT (size); | 4538 | isize = XINT (size); |
| 4539 | if (! (INT_MIN <= isize && isize <= INT_MAX)) | 4539 | if (! (INT_MIN <= isize && isize <= INT_MAX)) |
| @@ -4601,7 +4601,7 @@ If the font is not OpenType font, CAPABILITY is nil. */) | |||
| 4601 | 4601 | ||
| 4602 | CHECK_FONT_GET_OBJECT (font_object, font); | 4602 | CHECK_FONT_GET_OBJECT (font_object, font); |
| 4603 | 4603 | ||
| 4604 | val = Fmake_vector (make_number (9), Qnil); | 4604 | val = make_uninit_vector (9); |
| 4605 | ASET (val, 0, AREF (font_object, FONT_NAME_INDEX)); | 4605 | ASET (val, 0, AREF (font_object, FONT_NAME_INDEX)); |
| 4606 | ASET (val, 1, AREF (font_object, FONT_FILE_INDEX)); | 4606 | ASET (val, 1, AREF (font_object, FONT_FILE_INDEX)); |
| 4607 | ASET (val, 2, make_number (font->pixel_size)); | 4607 | ASET (val, 2, make_number (font->pixel_size)); |
| @@ -4612,6 +4612,8 @@ If the font is not OpenType font, CAPABILITY is nil. */) | |||
| 4612 | ASET (val, 7, make_number (font->average_width)); | 4612 | ASET (val, 7, make_number (font->average_width)); |
| 4613 | if (font->driver->otf_capability) | 4613 | if (font->driver->otf_capability) |
| 4614 | ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font))); | 4614 | ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font))); |
| 4615 | else | ||
| 4616 | ASET (val, 8, Qnil); | ||
| 4615 | return val; | 4617 | return val; |
| 4616 | } | 4618 | } |
| 4617 | 4619 | ||
| @@ -4704,7 +4706,7 @@ the corresponding element is nil. */) | |||
| 4704 | chars = aref_addr (object, XFASTINT (from)); | 4706 | chars = aref_addr (object, XFASTINT (from)); |
| 4705 | } | 4707 | } |
| 4706 | 4708 | ||
| 4707 | vec = Fmake_vector (make_number (len), Qnil); | 4709 | vec = make_uninit_vector (len); |
| 4708 | for (i = 0; i < len; i++) | 4710 | for (i = 0; i < len; i++) |
| 4709 | { | 4711 | { |
| 4710 | Lisp_Object g; | 4712 | Lisp_Object g; |
| @@ -4714,8 +4716,11 @@ the corresponding element is nil. */) | |||
| 4714 | 4716 | ||
| 4715 | code = font->driver->encode_char (font, c); | 4717 | code = font->driver->encode_char (font, c); |
| 4716 | if (code == FONT_INVALID_CODE) | 4718 | if (code == FONT_INVALID_CODE) |
| 4717 | continue; | 4719 | { |
| 4718 | g = Fmake_vector (make_number (LGLYPH_SIZE), Qnil); | 4720 | ASET (vec, i, Qnil); |
| 4721 | continue; | ||
| 4722 | } | ||
| 4723 | g = LGLYPH_NEW (); | ||
| 4719 | LGLYPH_SET_FROM (g, i); | 4724 | LGLYPH_SET_FROM (g, i); |
| 4720 | LGLYPH_SET_TO (g, i); | 4725 | LGLYPH_SET_TO (g, i); |
| 4721 | LGLYPH_SET_CHAR (g, c); | 4726 | LGLYPH_SET_CHAR (g, c); |
| @@ -4756,7 +4761,7 @@ character at index specified by POSITION. */) | |||
| 4756 | 4761 | ||
| 4757 | if (NILP (string)) | 4762 | if (NILP (string)) |
| 4758 | { | 4763 | { |
| 4759 | if (XBUFFER (w->buffer) != current_buffer) | 4764 | if (XBUFFER (w->contents) != current_buffer) |
| 4760 | error ("Specified window is not displaying the current buffer."); | 4765 | error ("Specified window is not displaying the current buffer."); |
| 4761 | CHECK_NUMBER_COERCE_MARKER (position); | 4766 | CHECK_NUMBER_COERCE_MARKER (position); |
| 4762 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) | 4767 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) |
| @@ -4827,7 +4832,7 @@ where | |||
| 4827 | OPENED-NAME is the name used for opening the font, | 4832 | OPENED-NAME is the name used for opening the font, |
| 4828 | FULL-NAME is the full name of the font, | 4833 | FULL-NAME is the full name of the font, |
| 4829 | SIZE is the pixelsize of the font, | 4834 | SIZE is the pixelsize of the font, |
| 4830 | HEIGHT is the pixel-height of the font (i.e ascent + descent), | 4835 | HEIGHT is the pixel-height of the font (i.e., ascent + descent), |
| 4831 | BASELINE-OFFSET is the upward offset pixels from ASCII baseline, | 4836 | BASELINE-OFFSET is the upward offset pixels from ASCII baseline, |
| 4832 | RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling | 4837 | RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling |
| 4833 | how to compose characters. | 4838 | how to compose characters. |
| @@ -4868,7 +4873,7 @@ If the named font is not yet loaded, return nil. */) | |||
| 4868 | return Qnil; | 4873 | return Qnil; |
| 4869 | font = XFONT_OBJECT (font_object); | 4874 | font = XFONT_OBJECT (font_object); |
| 4870 | 4875 | ||
| 4871 | info = Fmake_vector (make_number (7), Qnil); | 4876 | info = make_uninit_vector (7); |
| 4872 | ASET (info, 0, AREF (font_object, FONT_NAME_INDEX)); | 4877 | ASET (info, 0, AREF (font_object, FONT_NAME_INDEX)); |
| 4873 | ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX)); | 4878 | ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX)); |
| 4874 | ASET (info, 2, make_number (font->pixel_size)); | 4879 | ASET (info, 2, make_number (font->pixel_size)); |
| @@ -4897,7 +4902,7 @@ build_style_table (const struct table_entry *entry, int nelement) | |||
| 4897 | int i, j; | 4902 | int i, j; |
| 4898 | Lisp_Object table, elt; | 4903 | Lisp_Object table, elt; |
| 4899 | 4904 | ||
| 4900 | table = Fmake_vector (make_number (nelement), Qnil); | 4905 | table = make_uninit_vector (nelement); |
| 4901 | for (i = 0; i < nelement; i++) | 4906 | for (i = 0; i < nelement; i++) |
| 4902 | { | 4907 | { |
| 4903 | for (j = 0; entry[i].names[j]; j++); | 4908 | for (j = 0; entry[i].names[j]; j++); |
| @@ -5161,7 +5166,7 @@ See `font-weight-table' for the format of the vector. */); | |||
| 5161 | XSYMBOL (intern_c_string ("font-width-table"))->constant = 1; | 5166 | XSYMBOL (intern_c_string ("font-width-table"))->constant = 1; |
| 5162 | 5167 | ||
| 5163 | staticpro (&font_style_table); | 5168 | staticpro (&font_style_table); |
| 5164 | font_style_table = Fmake_vector (make_number (3), Qnil); | 5169 | font_style_table = make_uninit_vector (3); |
| 5165 | ASET (font_style_table, 0, Vfont_weight_table); | 5170 | ASET (font_style_table, 0, Vfont_weight_table); |
| 5166 | ASET (font_style_table, 1, Vfont_slant_table); | 5171 | ASET (font_style_table, 1, Vfont_slant_table); |
| 5167 | ASET (font_style_table, 2, Vfont_width_table); | 5172 | ASET (font_style_table, 2, Vfont_width_table); |