mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
26212f0f3b
* 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.
53 lines
1.1 KiB
C
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);
|