Page 1 of 1
Posted: 2006-03-27T08:46:15-07:00
by magick
The best path forward would be post a working program that illustrates the possible memory leak so that we can run it, reproduce the problem, and offer a solution. We do run a memory leak detector on ImageMagick code but its possible a leak went undetected.
Magick++ has the DrawableFont() method where you can set the family, style, weight, and stretch.
Posted: 2006-03-27T10:03:13-07:00
by magick
In the image class you can use a font filename to identify a particular font file (e.g. arial.ttf) but you can also use font handles. A font handle searches the type.xml configuration file for a matching font. In this file you can set the font style, weight, etc. For example, you will find Helvetica defined in type-ghostscript.xml as
- <type
name="Helvetica"
fullname="Helvetica Regular"
family="Helvetica"
foundry="URW"
weight="400"
style="normal"
stretch="normal"
format="type1"
metrics="/usr/local/share/ghostscript/fonts/n019003l.afm"
glyphs="/usr/local/share/ghostscript/fonts/n019003l.pfb"
/>
You can also use the MagickLib::GetTypeInfoByFamily() method whose signature is
- const TypeInfo *GetTypeInfoByFamily(const char *family,
const StyleType style,const StretchType stretch,
const unsigned long weight,ExceptionInfo *exception)
then use MagickLib::GetTypeInfoByFamily()->name as the image->font() parameter.