summaryrefslogtreecommitdiff
path: root/rufl.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-07-20 23:09:09 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-07-20 23:09:09 +0000
commit406f2c0a523141829e14b98068e3905e6f89c3ac (patch)
tree9e6d1080df086c0d6c1f2f0f935578c5d3c47062 /rufl.h
parentf08f15e06aed53db8270110c787ba91be2201b9d (diff)
downloadlibrufl-406f2c0a523141829e14b98068e3905e6f89c3ac.tar.gz
librufl-406f2c0a523141829e14b98068e3905e6f89c3ac.tar.bz2
Merge my local changes into head; I've been sitting on these for far too long.
This comprises: 1) Centralised internal font family / sized font lookup (rufl_find.c) 2) Methods to provide access to font and glyph metrics (rufl_metrics.c) 3) Glyph decomposition into path segments (rufl_decompose.c) svn path=/trunk/rufl/; revision=2788
Diffstat (limited to 'rufl.h')
-rw-r--r--rufl.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/rufl.h b/rufl.h
index b2a8d1f..1e541aa 100644
--- a/rufl.h
+++ b/rufl.h
@@ -55,6 +55,17 @@ extern char **rufl_family_list;
/** Number of entries in rufl_family_list. */
extern unsigned int rufl_family_list_entries;
+/* Callbacks used by rufl_decompose_glyph */
+typedef int (*rufl_move_to_func)(os_coord *to, void *user);
+typedef int (*rufl_line_to_func)(os_coord *to, void *user);
+typedef int (*rufl_cubic_to_func)(os_coord *control1, os_coord *control2,
+ os_coord *to, void *user);
+
+struct rufl_decomp_funcs {
+ rufl_move_to_func move_to;
+ rufl_line_to_func line_to;
+ rufl_cubic_to_func cubic_to;
+};
/**
* Initialise RUfl.
@@ -126,6 +137,39 @@ rufl_code rufl_paint_callback(const char *font_family, rufl_style font_style,
/**
+ * Decompose a glyph to a path.
+ */
+
+rufl_code rufl_decompose_glyph(const char *font_family,
+ rufl_style font_style, unsigned int font_size,
+ const char *string, size_t length,
+ struct rufl_decomp_funcs *funcs, void *user);
+
+
+/**
+ * Read metrics for a font
+ */
+
+rufl_code rufl_font_metrics(const char *font_family, rufl_style font_style,
+ os_box *bbox, int *xkern, int *ykern, int *italic,
+ int *ascent, int *descent,
+ int *xheight, int *cap_height,
+ signed char *uline_position, unsigned char *uline_thickness);
+
+
+/**
+ * Read metrics for a glyph
+ */
+
+rufl_code rufl_glyph_metrics(const char *font_family,
+ rufl_style font_style, unsigned int font_size,
+ const char *string, size_t length,
+ int *x_bearing, int *y_bearing,
+ int *width, int *height,
+ int *x_advance, int *y_advance);
+
+
+/**
* Determine the maximum bounding box of a font.
*/