status = _cairo_cache_lookup (cache, &key, (void **) &entry); _unlock_global_ft_cache ();
FcPatternAddInteger (pattern, FC_PIXEL_SIZE, sf.y_scale);
_cairo_ft_font_create (const char           *family,                        cairo_font_slant_t   slant,                        cairo_font_weight_t  weight){    cairo_status_t status;    cairo_ft_font_t *font = NULL;    int fcslant;    int fcweight;    cairo_cache_t *cache;    cairo_ft_cache_entry_t *entry;    cairo_ft_cache_key_t key;    key.pattern = FcPatternCreate ();    if (key.pattern == NULL)	goto FAIL;    font = malloc (sizeof (cairo_ft_font_t));    if (font == NULL)	goto FREE_PATTERN;    switch (weight)    {    case CAIRO_FONT_WEIGHT_BOLD:        fcweight = FC_WEIGHT_BOLD;        break;    case CAIRO_FONT_WEIGHT_NORMAL:    default:        fcweight = FC_WEIGHT_MEDIUM;        break;    }    switch (slant)    {    case CAIRO_FONT_SLANT_ITALIC:        fcslant = FC_SLANT_ITALIC;        break;    case CAIRO_FONT_SLANT_OBLIQUE:	fcslant = FC_SLANT_OBLIQUE;        break;    case CAIRO_FONT_SLANT_NORMAL:    default:        fcslant = FC_SLANT_ROMAN;        break;    }    FcPatternAddString (key.pattern, FC_FAMILY, family);    FcPatternAddInteger (key.pattern, FC_SLANT, fcslant);    FcPatternAddInteger (key.pattern, FC_WEIGHT, fcweight);    if (_cairo_unscaled_font_init (&font->base, &cairo_ft_font_backend))	goto FREE_PATTERN;    _lock_global_ft_cache ();    cache = _get_global_ft_cache ();    if (cache == NULL) {	_unlock_global_ft_cache ();	goto FREE_PATTERN;    }        status = _cairo_cache_lookup (cache, &key, (void **) &entry);    _unlock_global_ft_cache ();    if (status)	goto FREE_PATTERN;    font->pattern = FcPatternDuplicate (entry->key.pattern);    if (font->pattern == NULL)	goto FREE_PATTERN;    font->val = entry->val;    _reference_font_val (font->val);        return &font->base;   FREE_PATTERN:    FcPatternDestroy (key.pattern); FAIL:    return NULL;}