diff options
| author | Paul Eggert | 2012-09-06 01:04:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-06 01:04:49 -0700 |
| commit | a864ef14570715dc3233fbbf2e9da7aa8f29729e (patch) | |
| tree | d350c376998ae3bf0ef69f3d708f766e515a3465 /src/xftfont.c | |
| parent | 0699fc18a5ea00b9a6d64b0e0ebf33b4723beb10 (diff) | |
| download | emacs-a864ef14570715dc3233fbbf2e9da7aa8f29729e.tar.gz emacs-a864ef14570715dc3233fbbf2e9da7aa8f29729e.zip | |
Use bool for booleans in font-related modules.
* font.c (font_intern_prop, font_style_to_value)
(font_style_symbolic, font_parse_xlfd, font_parse_fcname)
(generate_otf_features, font_check_otf_features, font_check_otf)
(font_match_p, font_list_entities, font_at):
* fontset.c (fontset_id_valid_p, reorder_font_vector
(fontset_find_font, Fset_fontset_font)
(face_suitable_for_char_p) [0]:
* ftfont.c (fc_initialized, ftfont_get_open_type_spec)
(ftfont_open, ftfont_text_extents, ftfont_check_otf):
(m17n_flt_initialized, ftfont_shape_by_flt):
* ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
* nsfont.m (nsfont_draw):
* w32font.c (w32font_draw):
* w32term.c (x_draw_glyphless_glyph_string_foreground):
Use bool for booleans.
* font.h: Adjust to above API changes.
(struct font, struct font_driver, struct font_driver_list):
Use bool for booleans.
(struct font): Remove useless member encoding_type.
All users removed.
* fontset.c, xftfont.c: Omit unnecessary static decls.
Diffstat (limited to 'src/xftfont.c')
| -rw-r--r-- | src/xftfont.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/xftfont.c b/src/xftfont.c index 5e60ab0c4d3..404b9124099 100644 --- a/src/xftfont.c +++ b/src/xftfont.c | |||
| @@ -52,7 +52,7 @@ struct xftfont_info | |||
| 52 | /* The following five members must be here in this order to be | 52 | /* The following five members must be here in this order to be |
| 53 | compatible with struct ftfont_info (in ftfont.c). */ | 53 | compatible with struct ftfont_info (in ftfont.c). */ |
| 54 | #ifdef HAVE_LIBOTF | 54 | #ifdef HAVE_LIBOTF |
| 55 | int maybe_otf; /* Flag to tell if this may be OTF or not. */ | 55 | bool maybe_otf; /* Flag to tell if this may be OTF or not. */ |
| 56 | OTF *otf; | 56 | OTF *otf; |
| 57 | #endif /* HAVE_LIBOTF */ | 57 | #endif /* HAVE_LIBOTF */ |
| 58 | FT_Size ft_size; | 58 | FT_Size ft_size; |
| @@ -92,7 +92,7 @@ xftfont_get_colors (FRAME_PTR f, struct face *face, GC gc, struct xftface_info * | |||
| 92 | else | 92 | else |
| 93 | { | 93 | { |
| 94 | XGCValues xgcv; | 94 | XGCValues xgcv; |
| 95 | int fg_done = 0, bg_done = 0; | 95 | bool fg_done = 0, bg_done = 0; |
| 96 | 96 | ||
| 97 | BLOCK_INPUT; | 97 | BLOCK_INPUT; |
| 98 | XGetGCValues (FRAME_X_DISPLAY (f), gc, | 98 | XGetGCValues (FRAME_X_DISPLAY (f), gc, |
| @@ -111,7 +111,7 @@ xftfont_get_colors (FRAME_PTR f, struct face *face, GC gc, struct xftface_info * | |||
| 111 | *bg = xftface_info->xft_fg, bg_done = 1; | 111 | *bg = xftface_info->xft_fg, bg_done = 1; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | if (fg_done + bg_done < 2) | 114 | if (! (fg_done & bg_done)) |
| 115 | { | 115 | { |
| 116 | XColor colors[2]; | 116 | XColor colors[2]; |
| 117 | 117 | ||
| @@ -137,19 +137,6 @@ xftfont_get_colors (FRAME_PTR f, struct face *face, GC gc, struct xftface_info * | |||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | 139 | ||
| 140 | static Lisp_Object xftfont_list (Lisp_Object, Lisp_Object); | ||
| 141 | static Lisp_Object xftfont_match (Lisp_Object, Lisp_Object); | ||
| 142 | static Lisp_Object xftfont_open (FRAME_PTR, Lisp_Object, int); | ||
| 143 | static void xftfont_close (FRAME_PTR, struct font *); | ||
| 144 | static int xftfont_prepare_face (FRAME_PTR, struct face *); | ||
| 145 | static void xftfont_done_face (FRAME_PTR, struct face *); | ||
| 146 | static int xftfont_has_char (Lisp_Object, int); | ||
| 147 | static unsigned xftfont_encode_char (struct font *, int); | ||
| 148 | static int xftfont_text_extents (struct font *, unsigned *, int, | ||
| 149 | struct font_metrics *); | ||
| 150 | static int xftfont_draw (struct glyph_string *, int, int, int, int, int); | ||
| 151 | static int xftfont_end_for_frame (FRAME_PTR f); | ||
| 152 | |||
| 153 | struct font_driver xftfont_driver; | 140 | struct font_driver xftfont_driver; |
| 154 | 141 | ||
| 155 | static Lisp_Object | 142 | static Lisp_Object |
| @@ -470,7 +457,7 @@ xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) | |||
| 470 | font->underline_thickness = 0; | 457 | font->underline_thickness = 0; |
| 471 | } | 458 | } |
| 472 | #ifdef HAVE_LIBOTF | 459 | #ifdef HAVE_LIBOTF |
| 473 | xftfont_info->maybe_otf = ft_face->face_flags & FT_FACE_FLAG_SFNT; | 460 | xftfont_info->maybe_otf = (ft_face->face_flags & FT_FACE_FLAG_SFNT) != 0; |
| 474 | xftfont_info->otf = NULL; | 461 | xftfont_info->otf = NULL; |
| 475 | #endif /* HAVE_LIBOTF */ | 462 | #endif /* HAVE_LIBOTF */ |
| 476 | xftfont_info->ft_size = ft_face->size; | 463 | xftfont_info->ft_size = ft_face->size; |
| @@ -630,7 +617,8 @@ xftfont_get_xft_draw (FRAME_PTR f) | |||
| 630 | } | 617 | } |
| 631 | 618 | ||
| 632 | static int | 619 | static int |
| 633 | xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background) | 620 | xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, |
| 621 | bool with_background) | ||
| 634 | { | 622 | { |
| 635 | FRAME_PTR f = s->f; | 623 | FRAME_PTR f = s->f; |
| 636 | struct face *face = s->face; | 624 | struct face *face = s->face; |
| @@ -711,15 +699,17 @@ xftfont_end_for_frame (FRAME_PTR f) | |||
| 711 | return 0; | 699 | return 0; |
| 712 | } | 700 | } |
| 713 | 701 | ||
| 714 | static int | 702 | static bool |
| 715 | xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, Lisp_Object entity) | 703 | xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, |
| 704 | Lisp_Object entity) | ||
| 716 | { | 705 | { |
| 717 | struct xftfont_info *info = (struct xftfont_info *) XFONT_OBJECT (font_object); | 706 | struct xftfont_info *info = (struct xftfont_info *) XFONT_OBJECT (font_object); |
| 718 | FcPattern *oldpat = info->xftfont->pattern; | 707 | FcPattern *oldpat = info->xftfont->pattern; |
| 719 | Display *display = FRAME_X_DISPLAY (f); | 708 | Display *display = FRAME_X_DISPLAY (f); |
| 720 | FcPattern *pat = FcPatternCreate (); | 709 | FcPattern *pat = FcPatternCreate (); |
| 721 | FcBool b1, b2; | 710 | FcBool b1, b2; |
| 722 | int ok = 0, i1, i2, r1, r2; | 711 | bool ok = 0; |
| 712 | int i1, i2, r1, r2; | ||
| 723 | 713 | ||
| 724 | xftfont_add_rendering_parameters (pat, entity); | 714 | xftfont_add_rendering_parameters (pat, entity); |
| 725 | XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat); | 715 | XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat); |