font->face = face;
font->base.unscaled_font = unscaled_font; _cairo_unscaled_font_reference (unscaled_font);
cairo_pdf_ft_font_create (cairo_pdf_document_t	*document,			  cairo_unscaled_font_t	*unscaled_font,			  cairo_font_scale_t	*scale){    cairo_font_t scaled_font;    FT_Face face;    cairo_pdf_ft_font_t *font;    unsigned long size;    int i, j;    /* FIXME: Why do I have to pass a scaled font to get the FT_Face? */    _cairo_font_init (&scaled_font, scale, unscaled_font);    face = cairo_ft_font_face (&scaled_font);    /* We currently only support freetype truetype fonts. */    size = 0;    if (!FT_IS_SFNT (face) ||	FT_Load_Sfnt_Table (face, TTAG_glyf, 0, NULL, &size) != 0)	return NULL;    font = malloc (sizeof (cairo_pdf_ft_font_t));    if (font == NULL)	return NULL;    font->base.unscaled_font = unscaled_font;    _cairo_unscaled_font_reference (unscaled_font);    font->base.backend = &cairo_pdf_ft_font_backend;    font->base.font_id = _cairo_pdf_document_new_object (document);    _cairo_array_init (&font->output, sizeof (char));    if (_cairo_array_grow_by (&font->output, 4096) != CAIRO_STATUS_SUCCESS)	goto fail1;    font->face = face;    font->glyphs = calloc (face->num_glyphs + 1, sizeof (ft_subset_glyph_t));    if (font->glyphs == NULL)	goto fail2;    font->parent_to_subset = calloc (face->num_glyphs, sizeof (int));    if (font->parent_to_subset == NULL)	goto fail3;    font->base.num_glyphs = 1;    font->base.x_min = face->bbox.xMin;    font->base.y_min = face->bbox.yMin;    font->base.x_max = face->bbox.xMax;    font->base.y_max = face->bbox.yMax;    font->base.ascent = face->ascender;    font->base.descent = face->descender;    font->base.base_font = strdup (face->family_name);    if (font->base.base_font == NULL)	goto fail4;    for (i = 0, j = 0; font->base.base_font[j]; j++) {	if (font->base.base_font[j] == ' ')	    continue;	font->base.base_font[i++] = font->base.base_font[j];    }    font->base.base_font[i] = '\0';    font->base.widths = calloc (face->num_glyphs, sizeof (int));    if (font->base.widths == NULL)	goto fail5;    font->status = CAIRO_STATUS_SUCCESS;    return &font->base; fail5:    free (font->base.base_font); fail4:    free (font->parent_to_subset); fail3:    free (font->glyphs); fail2:    _cairo_array_fini (&font->output); fail1:    free (font);    return NULL;}