diff options
Diffstat (limited to 'src/font.c')
| -rw-r--r-- | src/font.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/font.c b/src/font.c index cf9964f08f3..49a09bced28 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -216,13 +216,12 @@ static int num_font_drivers; | |||
| 216 | 216 | ||
| 217 | 217 | ||
| 218 | /* Return a Lispy value of a font property value at STR and LEN bytes. | 218 | /* Return a Lispy value of a font property value at STR and LEN bytes. |
| 219 | If STR is "*", return nil. | 219 | If STR is "*", return nil. If FORCE_SYMBOL, or if STR does not |
| 220 | If FORCE_SYMBOL is zero and all characters in STR are digits, | 220 | consist entirely of one or more digits, return a symbol interned |
| 221 | return an integer. Otherwise, return a symbol interned from | 221 | from STR. Otherwise, return an integer. */ |
| 222 | STR. */ | ||
| 223 | 222 | ||
| 224 | Lisp_Object | 223 | Lisp_Object |
| 225 | font_intern_prop (const char *str, ptrdiff_t len, int force_symbol) | 224 | font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol) |
| 226 | { | 225 | { |
| 227 | ptrdiff_t i; | 226 | ptrdiff_t i; |
| 228 | Lisp_Object tem; | 227 | Lisp_Object tem; |
| @@ -306,7 +305,8 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec) | |||
| 306 | VAL is an integer. */ | 305 | VAL is an integer. */ |
| 307 | 306 | ||
| 308 | int | 307 | int |
| 309 | font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror) | 308 | font_style_to_value (enum font_property_index prop, Lisp_Object val, |
| 309 | bool noerror) | ||
| 310 | { | 310 | { |
| 311 | Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); | 311 | Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX); |
| 312 | int len; | 312 | int len; |
| @@ -385,7 +385,8 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror | |||
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | Lisp_Object | 387 | Lisp_Object |
| 388 | font_style_symbolic (Lisp_Object font, enum font_property_index prop, int for_face) | 388 | font_style_symbolic (Lisp_Object font, enum font_property_index prop, |
| 389 | bool for_face) | ||
| 389 | { | 390 | { |
| 390 | Lisp_Object val = AREF (font, prop); | 391 | Lisp_Object val = AREF (font, prop); |
| 391 | Lisp_Object table, elt; | 392 | Lisp_Object table, elt; |
| @@ -1101,7 +1102,7 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font) | |||
| 1101 | } | 1102 | } |
| 1102 | else | 1103 | else |
| 1103 | { | 1104 | { |
| 1104 | int wild_card_found = 0; | 1105 | bool wild_card_found = 0; |
| 1105 | Lisp_Object prop[XLFD_LAST_INDEX]; | 1106 | Lisp_Object prop[XLFD_LAST_INDEX]; |
| 1106 | 1107 | ||
| 1107 | if (FONT_ENTITY_P (font)) | 1108 | if (FONT_ENTITY_P (font)) |
| @@ -1337,7 +1338,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font) | |||
| 1337 | } | 1338 | } |
| 1338 | else if (*p == '-') | 1339 | else if (*p == '-') |
| 1339 | { | 1340 | { |
| 1340 | int decimal = 0, size_found = 1; | 1341 | bool decimal = 0, size_found = 1; |
| 1341 | for (q = p + 1; *q && *q != ':'; q++) | 1342 | for (q = p + 1; *q && *q != ':'; q++) |
| 1342 | if (! c_isdigit (*q)) | 1343 | if (! c_isdigit (*q)) |
| 1343 | { | 1344 | { |
| @@ -1938,7 +1939,7 @@ generate_otf_features (Lisp_Object spec, char *features) | |||
| 1938 | { | 1939 | { |
| 1939 | Lisp_Object val; | 1940 | Lisp_Object val; |
| 1940 | char *p; | 1941 | char *p; |
| 1941 | int asterisk; | 1942 | bool asterisk; |
| 1942 | 1943 | ||
| 1943 | p = features; | 1944 | p = features; |
| 1944 | *p = '\0'; | 1945 | *p = '\0'; |
| @@ -2302,11 +2303,12 @@ font_update_sort_order (int *order) | |||
| 2302 | } | 2303 | } |
| 2303 | } | 2304 | } |
| 2304 | 2305 | ||
| 2305 | static int | 2306 | static bool |
| 2306 | font_check_otf_features (Lisp_Object script, Lisp_Object langsys, Lisp_Object features, Lisp_Object table) | 2307 | font_check_otf_features (Lisp_Object script, Lisp_Object langsys, |
| 2308 | Lisp_Object features, Lisp_Object table) | ||
| 2307 | { | 2309 | { |
| 2308 | Lisp_Object val; | 2310 | Lisp_Object val; |
| 2309 | int negative; | 2311 | bool negative; |
| 2310 | 2312 | ||
| 2311 | table = assq_no_quit (script, table); | 2313 | table = assq_no_quit (script, table); |
| 2312 | if (NILP (table)) | 2314 | if (NILP (table)) |
| @@ -2342,7 +2344,7 @@ font_check_otf_features (Lisp_Object script, Lisp_Object langsys, Lisp_Object fe | |||
| 2342 | 2344 | ||
| 2343 | /* Check if OTF_CAPABILITY satisfies SPEC (otf-spec). */ | 2345 | /* Check if OTF_CAPABILITY satisfies SPEC (otf-spec). */ |
| 2344 | 2346 | ||
| 2345 | static int | 2347 | static bool |
| 2346 | font_check_otf (Lisp_Object spec, Lisp_Object otf_capability) | 2348 | font_check_otf (Lisp_Object spec, Lisp_Object otf_capability) |
| 2347 | { | 2349 | { |
| 2348 | Lisp_Object script, langsys = Qnil, gsub = Qnil, gpos = Qnil; | 2350 | Lisp_Object script, langsys = Qnil, gsub = Qnil, gpos = Qnil; |
| @@ -2376,7 +2378,7 @@ font_check_otf (Lisp_Object spec, Lisp_Object otf_capability) | |||
| 2376 | /* Check if FONT (font-entity or font-object) matches with the font | 2378 | /* Check if FONT (font-entity or font-object) matches with the font |
| 2377 | specification SPEC. */ | 2379 | specification SPEC. */ |
| 2378 | 2380 | ||
| 2379 | int | 2381 | bool |
| 2380 | font_match_p (Lisp_Object spec, Lisp_Object font) | 2382 | font_match_p (Lisp_Object spec, Lisp_Object font) |
| 2381 | { | 2383 | { |
| 2382 | Lisp_Object prop[FONT_SPEC_MAX], *props; | 2384 | Lisp_Object prop[FONT_SPEC_MAX], *props; |
| @@ -2694,7 +2696,7 @@ font_list_entities (Lisp_Object frame, Lisp_Object spec) | |||
| 2694 | Lisp_Object ftype, val; | 2696 | Lisp_Object ftype, val; |
| 2695 | Lisp_Object list = Qnil; | 2697 | Lisp_Object list = Qnil; |
| 2696 | int size; | 2698 | int size; |
| 2697 | int need_filtering = 0; | 2699 | bool need_filtering = 0; |
| 2698 | int i; | 2700 | int i; |
| 2699 | 2701 | ||
| 2700 | eassert (FONT_SPEC_P (spec)); | 2702 | eassert (FONT_SPEC_P (spec)); |
| @@ -3036,15 +3038,14 @@ font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, | |||
| 3036 | { | 3038 | { |
| 3037 | Lisp_Object font_entity; | 3039 | Lisp_Object font_entity; |
| 3038 | Lisp_Object prefer; | 3040 | Lisp_Object prefer; |
| 3039 | int result, i; | 3041 | int i; |
| 3040 | FRAME_PTR f = XFRAME (frame); | 3042 | FRAME_PTR f = XFRAME (frame); |
| 3041 | 3043 | ||
| 3042 | if (NILP (XCDR (entities)) | 3044 | if (NILP (XCDR (entities)) |
| 3043 | && ASIZE (XCAR (entities)) == 1) | 3045 | && ASIZE (XCAR (entities)) == 1) |
| 3044 | { | 3046 | { |
| 3045 | font_entity = AREF (XCAR (entities), 0); | 3047 | font_entity = AREF (XCAR (entities), 0); |
| 3046 | if (c < 0 | 3048 | if (c < 0 || font_has_char (f, font_entity, c) > 0) |
| 3047 | || (result = font_has_char (f, font_entity, c)) > 0) | ||
| 3048 | return font_entity; | 3049 | return font_entity; |
| 3049 | return Qnil; | 3050 | return Qnil; |
| 3050 | } | 3051 | } |
| @@ -3618,7 +3619,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, | |||
| 3618 | Lisp_Object string) | 3619 | Lisp_Object string) |
| 3619 | { | 3620 | { |
| 3620 | FRAME_PTR f; | 3621 | FRAME_PTR f; |
| 3621 | int multibyte; | 3622 | bool multibyte; |
| 3622 | Lisp_Object font_object; | 3623 | Lisp_Object font_object; |
| 3623 | 3624 | ||
| 3624 | multibyte = (NILP (string) | 3625 | multibyte = (NILP (string) |