Text overlay: Chopped in half

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mattalexx

Text overlay: Chopped in half

Post by mattalexx »

Okay, I'm trying to convert text into an image using the following code:

Code: Select all

convert -font Frutiger57-Condensed-Roman.ttf -pointsize 20 label:TESTING test.png
The problem is, I come out with this:

Image

I think it's probably the font file because if I use another font file, it works. Does anyone know what could be going on here with this font file and how I could fix it?

Here's the font file:
http://alexandersitedesign.com/_misc/Fr ... -Roman.ttf

Version: ImageMagick 6.3.7 02/19/08 Q16
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Text overlay: Chopped in half

Post by fmw42 »

same command works fine with TimesNewRoman. so I suspect it is your font file, possibly the way it is formatted or a corruption.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Text overlay: Chopped in half

Post by magick »

ImageMagick computes the label size based on the font metrics returned by the Freetype delegate library which in turn gets them from the font file itself. Its possible the font file has improper font metrics or that Freetype is not returning correct metrics.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Text overlay: Chopped in half

Post by anthony »

See IM Examples, Text, Bounding Box Overflow
http://imagemagick.org/Usage/text/#overflow
Remember this problem is NOT a bug in IM, but caused by the interaction of the the font library IM uses, and the settings within the font itself, usually on purpose by the font designer. IM just uses the results as they are programmed in the font, which does not always produce what the user intended. Caution is thus advised with unusual fonts.
Solution as give previously.
  • Use a better font, or get that font fixed
  • Annotate the font on a larger canvas that you provide.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
mattalexx

Re: Text overlay: Chopped in half

Post by mattalexx »

Thank you for your help. I replaced the font file with another version and it worked like a charm.

By the way, does anyone know a good program for editing font info? I work in Linux but I have access to Windows too.

Again, thanks.
mattalexx

Re: Text overlay: Chopped in half

Post by mattalexx »

bump
Post Reply