aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftfont.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/ftfont.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/ftfont.c')
-rw-r--r--src/ftfont.c28
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;
45static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif; 45static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;
46 46
47/* Flag to tell if FcInit is already called or not. */ 47/* Flag to tell if FcInit is already called or not. */
48static int fc_initialized; 48static bool fc_initialized;
49 49
50/* Handle to a FreeType library instance. */ 50/* Handle to a FreeType library instance. */
51static FT_Library ft_library; 51static FT_Library ft_library;
@@ -65,7 +65,7 @@ struct ftfont_info
65#ifdef HAVE_LIBOTF 65#ifdef HAVE_LIBOTF
66 /* The following four members must be here in this order to be 66 /* The following four members must be here in this order to be
67 compatible with struct xftfont_info (in xftfont.c). */ 67 compatible with struct xftfont_info (in xftfont.c). */
68 int maybe_otf; /* Flag to tell if this may be OTF or not. */ 68 bool maybe_otf; /* Flag to tell if this may be OTF or not. */
69 OTF *otf; 69 OTF *otf;
70#endif /* HAVE_LIBOTF */ 70#endif /* HAVE_LIBOTF */
71 FT_Size ft_size; 71 FT_Size ft_size;
@@ -543,9 +543,9 @@ struct font_driver ftfont_driver =
543 /* We can't draw a text without device dependent functions. */ 543 /* We can't draw a text without device dependent functions. */
544 NULL, /* draw */ 544 NULL, /* draw */
545 ftfont_get_bitmap, 545 ftfont_get_bitmap,
546 NULL, /* get_bitmap */
547 NULL, /* free_bitmap */ 546 NULL, /* free_bitmap */
548 NULL, /* get_outline */ 547 NULL, /* get_outline */
548 NULL, /* free_outline */
549 ftfont_anchor_point, 549 ftfont_anchor_point,
550#ifdef HAVE_LIBOTF 550#ifdef HAVE_LIBOTF
551 ftfont_otf_capability, 551 ftfont_otf_capability,
@@ -661,7 +661,8 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec)
661{ 661{
662 struct OpenTypeSpec *spec = malloc (sizeof *spec); 662 struct OpenTypeSpec *spec = malloc (sizeof *spec);
663 Lisp_Object val; 663 Lisp_Object val;
664 int i, j, negative; 664 int i, j;
665 bool negative;
665 666
666 if (! spec) 667 if (! spec)
667 return NULL; 668 return NULL;
@@ -1185,7 +1186,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
1185 FT_Size ft_size; 1186 FT_Size ft_size;
1186 FT_UInt size; 1187 FT_UInt size;
1187 Lisp_Object val, filename, idx, cache, font_object; 1188 Lisp_Object val, filename, idx, cache, font_object;
1188 int scalable; 1189 bool scalable;
1189 int spacing; 1190 int spacing;
1190 char name[256]; 1191 char name[256];
1191 int i, len; 1192 int i, len;
@@ -1243,7 +1244,7 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
1243 ftfont_info->ft_size = ft_face->size; 1244 ftfont_info->ft_size = ft_face->size;
1244 ftfont_info->index = XINT (idx); 1245 ftfont_info->index = XINT (idx);
1245#ifdef HAVE_LIBOTF 1246#ifdef HAVE_LIBOTF
1246 ftfont_info->maybe_otf = ft_face->face_flags & FT_FACE_FLAG_SFNT; 1247 ftfont_info->maybe_otf = (ft_face->face_flags & FT_FACE_FLAG_SFNT) != 0;
1247 ftfont_info->otf = NULL; 1248 ftfont_info->otf = NULL;
1248#endif /* HAVE_LIBOTF */ 1249#endif /* HAVE_LIBOTF */
1249 /* This means that there's no need of transformation. */ 1250 /* 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
1392 struct ftfont_info *ftfont_info = (struct ftfont_info *) font; 1393 struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
1393 FT_Face ft_face = ftfont_info->ft_size->face; 1394 FT_Face ft_face = ftfont_info->ft_size->face;
1394 int width = 0; 1395 int width = 0;
1395 int i, first; 1396 int i;
1397 bool first;
1396 1398
1397 if (ftfont_info->ft_size != ft_face->size) 1399 if (ftfont_info->ft_size != ft_face->size)
1398 FT_Activate_Size (ftfont_info->ft_size); 1400 FT_Activate_Size (ftfont_info->ft_size);
@@ -1682,10 +1684,12 @@ ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec)
1682 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; 1684 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
1683 OTF *otf = flt_font_ft->otf; 1685 OTF *otf = flt_font_ft->otf;
1684 OTF_Tag *tags; 1686 OTF_Tag *tags;
1685 int i, n, negative; 1687 int i, n;
1688 bool negative;
1686 1689
1687 if (FEATURE_ANY (0) && FEATURE_ANY (1)) 1690 if (FEATURE_ANY (0) && FEATURE_ANY (1))
1688 /* Return 1 iff any of GSUB or GPOS support the script (and language). */ 1691 /* Return true iff any of GSUB or GPOS support the script (and
1692 language). */
1689 return (otf 1693 return (otf
1690 && (OTF_check_features (otf, 0, spec->script, spec->langsys, 1694 && (OTF_check_features (otf, 0, spec->script, spec->langsys,
1691 NULL, 0) > 0 1695 NULL, 0) > 0
@@ -2390,7 +2394,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2390 2394
2391static MFLTGlyphString gstring; 2395static MFLTGlyphString gstring;
2392 2396
2393static int m17n_flt_initialized; 2397static bool m17n_flt_initialized;
2394 2398
2395static Lisp_Object 2399static Lisp_Object
2396ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, 2400ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
@@ -2400,7 +2404,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
2400 ptrdiff_t i; 2404 ptrdiff_t i;
2401 struct MFLTFontFT flt_font_ft; 2405 struct MFLTFontFT flt_font_ft;
2402 MFLT *flt = NULL; 2406 MFLT *flt = NULL;
2403 int with_variation_selector = 0; 2407 bool with_variation_selector = 0;
2404 2408
2405 if (! m17n_flt_initialized) 2409 if (! m17n_flt_initialized)
2406 { 2410 {
@@ -2421,7 +2425,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
2421 break; 2425 break;
2422 c = LGLYPH_CHAR (g); 2426 c = LGLYPH_CHAR (g);
2423 if (CHAR_VARIATION_SELECTOR_P (c)) 2427 if (CHAR_VARIATION_SELECTOR_P (c))
2424 with_variation_selector++; 2428 with_variation_selector = 1;
2425 } 2429 }
2426 2430
2427 len = i; 2431 len = i;