summaryrefslogtreecommitdiff
path: root/src/cairo-ft.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-29 11:51:02 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-29 12:04:54 +0000
commit2587b9dfd391fc1dc6e20eaa4c2d64fafe2e809b (patch)
tree3068ac7dd71431160812c151fb0457759f381873 /src/cairo-ft.h
parent231f0e32b916d436465fe16cfa38da27eb4df698 (diff)
downloadcairo-2587b9dfd391fc1dc6e20eaa4c2d64fafe2e809b.tar.gz
ft: Export FreeType synthesis options
Currently you can only specify that a cairo_ft_font_face_t should synthesize a font (to make a bold variant) through an FcPattern. That is direct consumers of the public cairo-ft API have no control over the synthesize options. Rectify this by creating some public API to allow control over the synthesis flags, and include the ability to construct an oblique as well an embolden font. Based on a patch by Deokjin Kim <deokjin81.kim@samsung.com>. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-ft.h')
-rw-r--r--src/cairo-ft.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/cairo-ft.h b/src/cairo-ft.h
index 56d48c328..90fea31f3 100644
--- a/src/cairo-ft.h
+++ b/src/cairo-ft.h
@@ -56,6 +56,43 @@ cairo_public cairo_font_face_t *
cairo_ft_font_face_create_for_ft_face (FT_Face face,
int load_flags);
+/**
+ * cairo_ft_synthesize_t:
+ *
+ * A set of synthesis options to control how FreeType renders the glyphs
+ * for a particular font face.
+ *
+ * Individual synthesis features of a #cairo_ft_font_face_t can be set
+ * using cairo_ft_font_face_set_synthesize(), or disabled using
+ * cairo_ft_font_face_unset_synthesize(). The currently enabled set of
+ * synthesis options can be queried with cairo_ft_font_face_get_synthesize().
+ *
+ * Note: that when synthesizing glyphs, the font metrics returned will only
+ * be estimates.
+ *
+ * @CAIRO_FT_SYNTHESIZE_BOLD: Embolden the glyphs (redraw with a pixel offset)
+ * @CAIRO_FT_SYNTHESIZE_OBLIQUE: Slant the glyph outline by 12 degrees to the
+ * right.
+ *
+ * Since 1.12.
+ **/
+typedef enum {
+ CAIRO_FT_SYNTHESIZE_BOLD = 1 << 0,
+ CAIRO_FT_SYNTHESIZE_OBLIQUE = 1 << 1
+} cairo_ft_synthesize_t;
+
+cairo_public void
+cairo_ft_font_face_set_synthesize (cairo_font_face_t *font_face,
+ unsigned int flags);
+
+cairo_public void
+cairo_ft_font_face_unset_synthesize (cairo_font_face_t *font_face,
+ unsigned int flags);
+
+cairo_public unsigned int
+cairo_ft_font_face_get_synthesize (cairo_font_face_t *font_face);
+
+
cairo_public FT_Face
cairo_ft_scaled_font_lock_face (cairo_scaled_font_t *scaled_font);