Cairo

 view release on metacpan or  search on metacpan

CairoFont.xs  view on Meta::CPAN


cairo_font_type_t cairo_scaled_font_get_type (cairo_scaled_font_t *scaled_font);

#endif

##cairo_status_t cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *extents);
cairo_font_extents_t * cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font)
    PREINIT:
	cairo_font_extents_t extents;
    CODE:
	cairo_scaled_font_extents (scaled_font, &extents);
	RETVAL = &extents;
    OUTPUT:
	RETVAL

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)

##void cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_text_extents_t *extents);
cairo_text_extents_t * cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, const char_utf8 *utf8)
    PREINIT:
	cairo_text_extents_t extents;
    CODE:
	cairo_scaled_font_text_extents (scaled_font, utf8, &extents);
	RETVAL = &extents;
    OUTPUT:
	RETVAL

#endif

##void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents);
cairo_text_extents_t * cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, ...)
    PREINIT:
	cairo_glyph_t * glyphs = NULL;
	int num_glyphs, i;
	cairo_text_extents_t extents;
    CODE:
	num_glyphs = items - 1;
	Newz (0, glyphs, num_glyphs, cairo_glyph_t);
	for (i = 1; i < items; i++)
		glyphs[i - 1] = *SvCairoGlyph (ST (i));
	cairo_scaled_font_glyph_extents (scaled_font, glyphs, num_glyphs, &extents);
	RETVAL = &extents;
	Safefree (glyphs);
    OUTPUT:
	RETVAL

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0)

##cairo_status_t cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, double x, double y, const char *utf8, int utf8_len, cairo_glyph_t **glyphs, int *num_glyphs, cairo_text_cluster_t **clusters, int *num_clusters, cairo_text_cluster_f...
void
cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, double x, double y, SV *utf8_sv)
    PREINIT:
	const char *utf8;
	STRLEN utf8_len;
	cairo_glyph_t *glyphs = NULL;
	int num_glyphs;
	cairo_text_cluster_t *clusters = NULL;
	int num_clusters;
	cairo_text_cluster_flags_t cluster_flags;
	cairo_status_t status;
    PPCODE:
	sv_utf8_upgrade (utf8_sv);
	utf8 = SvPV (utf8_sv, utf8_len);
	status = cairo_scaled_font_text_to_glyphs (
	           scaled_font,
	           x, y,
	           utf8, utf8_len,
	           &glyphs, &num_glyphs,
	           &clusters, &num_clusters, &cluster_flags);
	PUSHs (sv_2mortal (newSVCairoStatus (status)));
	if (CAIRO_STATUS_SUCCESS == status) {
		AV *glyphs_av, *clusters_av;
		int i;
		glyphs_av = newAV ();
		for (i = 0; i < num_glyphs; i++)
			av_push (glyphs_av, newSVCairoGlyph (&glyphs[i]));
		cairo_glyph_free (glyphs);
		clusters_av = newAV ();
		for (i = 0; i < num_clusters; i++)
			av_push (clusters_av, newSVCairoTextCluster (&clusters[i]));
		cairo_text_cluster_free (clusters);
		EXTEND (SP, 4);
		PUSHs (sv_2mortal (newRV_noinc ((SV *) glyphs_av)));
		PUSHs (sv_2mortal (newRV_noinc ((SV *) clusters_av)));
		PUSHs (sv_2mortal (newSVCairoTextClusterFlags (cluster_flags)));
	}


#endif

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)

cairo_font_face_t * cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font);

##void cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font, cairo_matrix_t *font_matrix);
cairo_matrix_t * cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font)
    PREINIT:
	cairo_matrix_t font_matrix;
    CODE:
	cairo_scaled_font_get_font_matrix (scaled_font, &font_matrix);
	RETVAL = cairo_perl_copy_matrix (&font_matrix);
    OUTPUT:
	RETVAL

##void cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font, cairo_matrix_t *ctm);
cairo_matrix_t * cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font)
    PREINIT:
	cairo_matrix_t ctm;
    CODE:
	cairo_scaled_font_get_ctm (scaled_font, &ctm);
	RETVAL = cairo_perl_copy_matrix (&ctm);
    OUTPUT:
	RETVAL

##void cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, cairo_font_options_t *options);
cairo_font_options_t * cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font)
    CODE:
	RETVAL = cairo_font_options_create ();
	cairo_scaled_font_get_font_options (scaled_font, RETVAL);
    OUTPUT:
	RETVAL



( run in 0.800 second using v1.01-cache-2.11-cpan-71847e10f99 )