/* ftfont.c -- FreeType font driver.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
/* Cache for FT_Face and FcCharSet. */
static Lisp_Object ft_face_cache;
-/* The actual structure for FreeType font that can be casted to struct
+/* The actual structure for FreeType font that can be cast to struct
font. */
struct ftfont_info
}
#endif /* HAVE_LIBOTF */
-static Lisp_Object ftfont_get_cache (FRAME_PTR);
+static Lisp_Object ftfont_get_cache (struct frame *);
static Lisp_Object ftfont_list (struct frame *, Lisp_Object);
static Lisp_Object ftfont_match (struct frame *, Lisp_Object);
static Lisp_Object ftfont_list_family (struct frame *);
-static Lisp_Object ftfont_open (FRAME_PTR, Lisp_Object, int);
-static void ftfont_close (FRAME_PTR, struct font *);
+static Lisp_Object ftfont_open (struct frame *, Lisp_Object, int);
+static void ftfont_close (struct font *);
static int ftfont_has_char (Lisp_Object, int);
static unsigned ftfont_encode_char (struct font *, int);
static int ftfont_text_extents (struct font *, unsigned *, int,
};
static Lisp_Object
-ftfont_get_cache (FRAME_PTR f)
+ftfont_get_cache (struct frame *f)
{
return freetype_font_cache;
}
if (otspec)
{
FcChar8 *file;
+ bool passed;
OTF *otf;
if (FcPatternGetString (fontset->fonts[i], FC_FILE, 0, &file)
otf = OTF_open ((char *) file);
if (! otf)
continue;
- if (OTF_check_features (otf, 1,
- otspec->script_tag, otspec->langsys_tag,
- otspec->features[0],
- otspec->nfeatures[0]) != 1
- || OTF_check_features (otf, 0,
- otspec->script_tag, otspec->langsys_tag,
- otspec->features[1],
- otspec->nfeatures[1]) != 1)
+ passed = (OTF_check_features (otf, 1, otspec->script_tag,
+ otspec->langsys_tag,
+ otspec->features[0],
+ otspec->nfeatures[0]) == 1
+ && OTF_check_features (otf, 0, otspec->script_tag,
+ otspec->langsys_tag,
+ otspec->features[1],
+ otspec->nfeatures[1]) == 1);
+ OTF_close (otf);
+ if (!passed)
continue;
}
#endif /* HAVE_LIBOTF */
static Lisp_Object
-ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
+ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
{
struct ftfont_info *ftfont_info;
struct font *font;
}
static void
-ftfont_close (FRAME_PTR f, struct font *font)
+ftfont_close (struct font *font)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
Lisp_Object val, cache;
bitmap->left = ft_face->glyph->bitmap_left;
bitmap->top = ft_face->glyph->bitmap_top;
bitmap->advance = ft_face->glyph->metrics.horiAdvance >> 6;
- bitmap->extra = NULL;
return 0;
}
}
len = i;
- lint_assume (len <= STRING_BYTES_BOUND);
if (with_variation_selector)
{