I use convert to convert a font png file like this,
convert -background '#000000' -fill '#ffffff' -font /tmp/MSYHBD.TTF -pointsize 16 -gravity north -size 16x2048 label:@chfile font.png
but, I found the vertical space of the characters in png file is high. I hope the characters arrenged one after another form top to bottom with the smallest space.
could someone give me some advice, thanks very much .
How to modify the vertical space ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to modify the vertical space ?
I don't think IM has line spacing attribute control, but see
http://www.imagemagick.org/Usage/text/#kerning
I will defer to the experts on this.
http://www.imagemagick.org/Usage/text/#kerning
I will defer to the experts on this.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to modify the vertical space ?
No we have controls to add/remove inter-character and inter-word, but we don't have inter-line spacing controls yet
One 'slow' technique is to use a script like divide-vert
http://www.imagemagick.org/Usage/scripts/divide-vert
to split the text lines into a sequence of line/blank images, and then splice an extra row to each image, before appending them back together.
See the top of the script for various techniques.
This has not been Exampled. The script is a 'proof of concept' for one form of image segmention.
As is the 'segment_image' script in the same directory.
One 'slow' technique is to use a script like divide-vert
http://www.imagemagick.org/Usage/scripts/divide-vert
to split the text lines into a sequence of line/blank images, and then splice an extra row to each image, before appending them back together.
See the top of the script for various techniques.
This has not been Exampled. The script is a 'proof of concept' for one form of image segmention.
As is the 'segment_image' script in the same directory.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to modify the vertical space ?
thank u very much , i will tryanthony wrote:No we have controls to add/remove inter-character and inter-word, but we don't have inter-line spacing controls yet
One 'slow' technique is to use a script like divide-vert
http://www.imagemagick.org/Usage/scripts/divide-vert
to split the text lines into a sequence of line/blank images, and then splice an extra row to each image, before appending them back together.
See the top of the script for various techniques.
This has not been Exampled. The script is a 'proof of concept' for one form of image segmention.
As is the 'segment_image' script in the same directory.