nautilus/librsvg/rsvg-ft.h
Ramiro Estrugo 26212f0f3b Add new function to only measure a string without doing all the rendering
* librsvg/rsvg-ft.c: (rsvg_ft_measure_or_render_string),
	(rsvg_ft_render_string), (rsvg_ft_measure_string):
	* librsvg/rsvg-ft.h:
	Add new function to only measure a string without doing all the
	rendering work.

	* libnautilus-extensions/nautilus-scalable-font.c:
	(nautilus_scalable_font_measure_text):
	Use the new rsvg_ft string measuring api.

	Fixes bug 2544.
2000-10-18 16:03:28 +00:00

53 lines
1.1 KiB
C

typedef struct _RsvgFTCtx RsvgFTCtx;
typedef struct _RsvgFTGlyph RsvgFTGlyph;
struct _RsvgFTGlyph {
int refcnt;
int width, height;
double xpen, ypen; /* relative location of pen after the glyph */
int rowstride;
guchar *buf;
};
typedef int RsvgFTFontHandle;
RsvgFTCtx *
rsvg_ft_ctx_new (void);
void
rsvg_ft_ctx_done (RsvgFTCtx *ctx);
RsvgFTFontHandle
rsvg_ft_intern (RsvgFTCtx *ctx, const char *font_file_name);
void
rsvg_ft_font_attach (RsvgFTCtx *ctx, RsvgFTFontHandle fh,
const char *font_file_name);
#if 0
void
rsvg_ft_font_ref (RsvgFTFont *font);
void
rsvg_ft_font_unref (RsvgFTFont *font);
#endif
RsvgFTGlyph *
rsvg_ft_render_string (RsvgFTCtx *ctx, RsvgFTFontHandle fh,
const char *str,
unsigned int length,
double sx, double sy,
const double affine[6], int xy[2]);
void
rsvg_ft_measure_string (RsvgFTCtx *ctx,
RsvgFTFontHandle fh,
const char *str,
unsigned int length,
double sx, double sy,
const double affine[6],
int xy[2],
unsigned int dimensions[2]);
void
rsvg_ft_glyph_unref (RsvgFTGlyph *glyph);