Problem with outlining text

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
Thndr
Posts: 3
Joined: 2017-09-02T14:01:40-07:00
Authentication code: 1151

Problem with outlining text

Post by Thndr » 2017-09-02T14:15:10-07:00

Hello!
Im having a bit of a problem, and I cant seem to figure out why. Im running ImageMagick ImageMagick 6.8.9-9 on a Raspberry Pi, OS Raspbian GNU/Linux 8 (jessie).

convert -size 800x120 -background yellow -font DejaVu-Sans -pointsize 40 \
-fill red -stroke black -strokewidth 1 \
label:"Album: This is a test!" -trim +repage album.png

This code was used to make multiple images, and it works fine on shorter strings, but once they reach a certain length it just stops in its tracks. Ive changed the colors to make it easier to see. The image needs to be dynamically sized to the text length.

Image

Changing the text to ABCDEFGHIJKLMNOP results in:
Image

What am I missing???

Thanks in advance!
Last edited by Thndr on 2017-09-02T14:40:05-07:00, edited 1 time in total.

Bonzo
Posts: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Problem with outlining text

Post by Bonzo » 2017-09-02T14:30:17-07:00

I would test it on a desktop as the Pi hardware could be the problem.

Also try a Q8 version if you are currently using a Q16 one?

User avatar
fmw42
Posts: 22080
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Problem with outlining text

Post by fmw42 » 2017-09-02T14:51:52-07:00

Your IM version is about 100 versions old. I suggest you upgrade.

It works fine on my Mac OS XSierra with IM 6.9.9.10 Q16. But my system objects to un-escaped slashes. So I had to escape it as:

Code: Select all

convert -size 800x120 -background yellow -font /Library/Fonts/DejaVuSans.ttf -pointsize 40 \
-fill red -stroke black -strokewidth 1 \
label:"Album: This is a test\!" -trim +repage album.png
Image

Also upgrade your version of freetype, if it is not current. My freetype is 2.8_0

Thndr
Posts: 3
Joined: 2017-09-02T14:01:40-07:00
Authentication code: 1151

Re: Problem with outlining text

Post by Thndr » 2017-09-02T14:55:12-07:00

Command works as expected in Windows. I guess it is my my setup. Let me try the Q8.

Image

Edit: Just saw post, thanks Fred. I was relying on apt-get it was telling me it was latest version, I see now thats not the case!

Thanks!

Thndr
Posts: 3
Joined: 2017-09-02T14:01:40-07:00
Authentication code: 1151

Re: Problem with outlining text

Post by Thndr » 2017-09-02T21:43:24-07:00

Update: I built IM from source on the RaspberryPi and all is well! Thanks for the guidance everyone!

Post Reply