How to draw vertical text?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
bkstorm
Posts: 8
Joined: 2017-04-27T23:22:30-07:00
Authentication code: 1151

How to draw vertical text?

Post by bkstorm »

Hi.
I want to draw vertical text like the image below. How can I do that? Thanks!
Image
Version: ImageMagick 7.0.7-33 Q16 x86_64 2018-05-17 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to draw vertical text?

Post by fmw42 »

Draw then using -annotate in columns using new lines \n (in unix) between characters. Then append the columns. For example for your first column:

Code: Select all

convert -size 50x200 xc:white -pointsize 28 -gravity north -annotate +0+0 "a\nd\na\nd\na" result.png
Post Reply