Re: [GM-help] One letter from font to graphic file?
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Bob F. <bfr...@si...> - 2003-08-22 10:15:41
|
On Wed, 20 Aug 2003, Denis Olivier wrote: > I would like for graphic animation generate only ONE letter of a > specific font (with color and transparent background in GIF format), > aliased, and the resulting picture cropped exactly to the letter width > and height, meaning for non proportional fonts that M letter will > larger then I generated one. > > Is this possible? I'm searching this since many months without any more > success than cropping with an image editor each letter myself.... This command is *supposed* to produce what you need: gm convert -background "#FFFFFFFF" -font Helvetica -pointsize 200 -fill blue "label:Z" -trim Z.gif Unfortunately, it seems that the antialiasing is actually done against black even though the transparency of the background color is being respected. Label: has other shortcomings as well. However, using the drawing facility produces better results: gm convert -size 200x200 "XC:#FFFFFFFF" -draw "fill green stroke green stroke-width 3 font-size 200 font helvetica text 0,150 'Z'" -trim Z.gif The trick here is that since the image is not auto-sized, you need to specify an image large enough to contain the rendered character and ensure that the text is placed entirely within the imaging area. The -trim command removes any unused border. It seems that there is an antialiasing bug related to stroke. If stroke is not specified, or is too narrow, then an ugly black border is generated around parts of the rendered glyph. Bob ====================================== Bob Friesenhahn bfr...@si... http://www.simplesystems.org/users/bfriesen |