From 6dce2778d911d8a08b492af1c5f43e707a1de790 Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Sun, 28 Aug 2011 19:41:27 +0200 Subject: Add the Draw / ImageInfo properties to the DrawingContext. --- dmagick/Options.d | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) (limited to 'dmagick/Options.d') diff --git a/dmagick/Options.d b/dmagick/Options.d index 5e7e033..d11366e 100644 --- a/dmagick/Options.d +++ b/dmagick/Options.d @@ -31,6 +31,7 @@ import dmagick.c.memory; import dmagick.c.option; import dmagick.c.quantize; import dmagick.c.quantum; +import dmagick.c.type; /** * A class that wraps ImageInfo, DrawInfo and QuantizeInfo @@ -858,6 +859,55 @@ class Options return drawInfo.fill_rule; } + /** + * Specify the font family, such as "arial" or "helvetica". + */ + void fontFamily(string type) + { + copyString(drawInfo.family, type); + } + ///ditto + string fontFamily() const + { + return to!(string)(drawInfo.family); + } + + void fontStretch(StretchType type) + { + drawInfo.stretch = type; + } + ///ditto + StretchType fontStretch() const + { + return drawInfo.stretch; + } + + /** + * Specify the font style, i.e. italic, oblique, or normal. + */ + void fontStyle(StyleType type) + { + drawInfo.style = type; + } + ///ditto + StyleType fontStyle() const + { + return drawInfo.style; + } + + /** + * Specify the font style, i.e. italic, oblique, or normal. + */ + void fontWeight(size_t weight) + { + drawInfo.weight = type; + } + ///ditto + size_t fontWeight() const + { + return drawInfo.weight; + } + /** * Enable or disable anti-aliasing when drawing object outlines. */ @@ -1054,10 +1104,6 @@ class Options //char* text; //size_t face; //char* metrics, - //char* family; - //StyleType style; - //StretchType stretch; - //size_t weight; //AlignType align; //char* clip_mask; //SegmentInfo bounds; -- cgit v1.2.3