diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-06 01:04:49 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-06 01:04:49 -0700 |
commit | a864ef14570715dc3233fbbf2e9da7aa8f29729e (patch) | |
tree | d350c376998ae3bf0ef69f3d708f766e515a3465 /src/ftfont.c | |
parent | 0699fc18a5ea00b9a6d64b0e0ebf33b4723beb10 (diff) | |
download | emacs-a864ef14570715dc3233fbbf2e9da7aa8f29729e.tar.gz |
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/ftfont.c')
-rw-r--r-- | src/ftfont.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index 10b53411248..a85773a9a21 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -45,7 +45,7 @@ static Lisp_Object Qfreetype; static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif; /* Flag to tell if FcInit is already called or not. */ -static int fc_initialized; +static bool fc_initialized; /* Handle to a FreeType library instance. */ static FT_Library ft_library; @@ -65,7 +65,7 @@ struct ftfont_info #ifdef HAVE_LIBOTF /* The following four members must be here in this order to be compatible with struct xftfont_info (in xftfont.c). */ - int maybe_otf; /* Flag to tell if this may be OTF or not. */ + bool maybe_otf; /* Flag to tell if this may be OTF or not. */ OTF *otf; #endif /* HAVE_LIBOTF */ FT_Size ft_size; @@ -543,9 +543,9 @@ struct font_driver ftfont_driver = /* We can't draw a text without device dependent functions. */ NULL, /* draw */ ftfont_get_bitmap, - NULL, /* get_bitmap */ NULL, /* free_bitmap */ NULL, /* get_outline */ + NULL, /* free_outline */ ftfont_anchor_point, #ifdef HAVE_LIBOTF ftfont_otf_capability, @@ -661,7 +661,8 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec) { struct OpenTypeSpec *spec = malloc (sizeof *spec); Lisp_Object val; - int i, j, negative; + int i, j; + bool negative; if (! spec) return NULL; @@ -1185,7 +1186,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) FT_Size ft_size; FT_UInt size; Lisp_Object val, filename, idx, cache, font_object; - int scalable; + bool scalable; int spacing; char name[256]; int i, len; @@ -1243,7 +1244,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) ftfont_info->ft_size = ft_face->size; ftfont_info->index = XINT (idx); #ifdef HAVE_LIBOTF - ftfont_info->maybe_otf = ft_face->face_flags & FT_FACE_FLAG_SFNT; + ftfont_info->maybe_otf = (ft_face->face_flags & FT_FACE_FLAG_SFNT) != 0; ftfont_info->otf = NULL; #endif /* HAVE_LIBOTF */ /* This means that there's no need of transformation. */ @@ -1392,7 +1393,8 @@ ftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct struct ftfont_info *ftfont_info = (struct ftfont_info *) font; FT_Face ft_face = ftfont_info->ft_size->face; int width = 0; - int i, first; + int i; + bool first; if (ftfont_info->ft_size != ft_face->size) FT_Activate_Size (ftfont_info->ft_size); @@ -1682,10 +1684,12 @@ ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec) struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; OTF *otf = flt_font_ft->otf; OTF_Tag *tags; - int i, n, negative; + int i, n; + bool negative; if (FEATURE_ANY (0) && FEATURE_ANY (1)) - /* Return 1 iff any of GSUB or GPOS support the script (and language). */ + /* Return true iff any of GSUB or GPOS support the script (and + language). */ return (otf && (OTF_check_features (otf, 0, spec->script, spec->langsys, NULL, 0) > 0 @@ -2390,7 +2394,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, static MFLTGlyphString gstring; -static int m17n_flt_initialized; +static bool m17n_flt_initialized; static Lisp_Object ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, @@ -2400,7 +2404,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, ptrdiff_t i; struct MFLTFontFT flt_font_ft; MFLT *flt = NULL; - int with_variation_selector = 0; + bool with_variation_selector = 0; if (! m17n_flt_initialized) { @@ -2421,7 +2425,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, break; c = LGLYPH_CHAR (g); if (CHAR_VARIATION_SELECTOR_P (c)) - with_variation_selector++; + with_variation_selector = 1; } len = i; |