How to draw text that includes apostrophes.

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
drewvy

How to draw text that includes apostrophes.

Post by drewvy »

I need to include apostrophes in the text I'm printing.

Here is the text I would like to produce.

BLUE X'Y'Z' Prime Values X'=2014 Y'=1416 Z'=3816


Here is how I draw text. I can't figure out how to get those apostrophes added without breaking the parsing of that statement.

-draw "text 100,550 ' BLUE X'Y'Z' Prime Values X'=2014 Y'=1416 Z'=3816 ' "

Thank you for your help,
Drew
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to draw text that includes apostrophes.

Post by snibgo »

To avoid problems like this, I use the "caption:@file.txt" style.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to draw text that includes apostrophes.

Post by magick »

Try this:
  • convert logo: -draw "stroke red text 100,100 ' BLUE X\'Y\'Z\' Prime Values X\'=2014 Y\'=1416 Z\'=3816 ' " logo.png
drewvy

Re: How to draw text that includes apostrophes.

Post by drewvy »

Works great! Thank you.
Post Reply