aboutsummaryrefslogtreecommitdiffstats
path: root/src/xftfont.c
diff options
context:
space:
mode:
authorPaul Eggert2012-09-06 01:04:49 -0700
committerPaul Eggert2012-09-06 01:04:49 -0700
commita864ef14570715dc3233fbbf2e9da7aa8f29729e (patch)
treed350c376998ae3bf0ef69f3d708f766e515a3465 /src/xftfont.c
parent0699fc18a5ea00b9a6d64b0e0ebf33b4723beb10 (diff)
downloademacs-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.c32
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
140static Lisp_Object xftfont_list (Lisp_Object, Lisp_Object);
141static Lisp_Object xftfont_match (Lisp_Object, Lisp_Object);
142static Lisp_Object xftfont_open (FRAME_PTR, Lisp_Object, int);
143static void xftfont_close (FRAME_PTR, struct font *);
144static int xftfont_prepare_face (FRAME_PTR, struct face *);
145static void xftfont_done_face (FRAME_PTR, struct face *);
146static int xftfont_has_char (Lisp_Object, int);
147static unsigned xftfont_encode_char (struct font *, int);
148static int xftfont_text_extents (struct font *, unsigned *, int,
149 struct font_metrics *);
150static int xftfont_draw (struct glyph_string *, int, int, int, int, int);
151static int xftfont_end_for_frame (FRAME_PTR f);
152
153struct font_driver xftfont_driver; 140struct font_driver xftfont_driver;
154 141
155static Lisp_Object 142static 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
632static int 619static int
633xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background) 620xftfont_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
714static int 702static bool
715xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, Lisp_Object entity) 703xftfont_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);