FT_ULong *ucs4 = NULL;
uint32_t *ucs4 = NULL;
_cairo_ft_font_text_to_glyphs (void			*abstract_font,			       cairo_font_scale_t	*sc,			       const unsigned char	*utf8,			       cairo_glyph_t		**glyphs, 			       int			*nglyphs){    double x = 0., y = 0.;    size_t i;    FT_ULong *ucs4 = NULL;    cairo_ft_font_t *font = abstract_font;    FT_Face face = font->val->face;    cairo_glyph_cache_key_t key;    cairo_image_glyph_cache_entry_t *val;    cairo_cache_t *cache;    key.unscaled = &font->base;    key.scale = *sc;    _utf8_to_ucs4 (utf8, &ucs4, nglyphs);    if (ucs4 == NULL)        return CAIRO_STATUS_NO_MEMORY;    *glyphs = (cairo_glyph_t *) malloc ((*nglyphs) * (sizeof (cairo_glyph_t)));    if (*glyphs == NULL)    {        free (ucs4);        return CAIRO_STATUS_NO_MEMORY;    }    _cairo_lock_global_image_glyph_cache ();    cache = _cairo_get_global_image_glyph_cache ();    if (cache == NULL) {	_cairo_unlock_global_image_glyph_cache ();	return CAIRO_STATUS_NO_MEMORY;    }    for (i = 0; i < *nglyphs; i++)    {                    (*glyphs)[i].index = FT_Get_Char_Index (face, ucs4[i]);	(*glyphs)[i].x = x;	(*glyphs)[i].y = y;		val = NULL;	key.index = (*glyphs)[i].index;	if (_cairo_cache_lookup (cache, &key, (void **) &val) 	    != CAIRO_STATUS_SUCCESS || val == NULL)	    continue;        x += val->extents.x_advance;        y += val->extents.y_advance;    }    _cairo_unlock_global_image_glyph_cache ();    free (ucs4);    return CAIRO_STATUS_SUCCESS;}