different fonts in the same caption

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
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

different fonts in the same caption

Post by troyd1 »

Is there a way to do 2 different fonts in the same caption? Say I was doing "this is a test of different fonts" and I wanted "this is a" in courier, "test of different" in arial and "fonts" in verdana. Can I do this or do I need to create 3 images and merge them?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: different fonts in the same caption

Post by fmw42 »

I will defer to the experts (Anthony and Magick), but I don't think you can do what you want directly. I tried and was unable. So I suspect you will need to make 3 images and merge them.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: different fonts in the same caption

Post by anthony »

all captions and labels in IM are all created using the current font settings. that is one font, size, density etc...

If you want multiple fonts, positions, styles etc. you will have to DIY the label and add it yourself.

Annotate Images in IM Examples gives some examples of appending or overlaying label images. the label can be generated in the same command, or pre-generated in a separate command.

If you want more specific help, then you will need to be more specific as to exactly what you are wanting. (SMALL examples can help too)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

Re: different fonts in the same caption

Post by troyd1 »

Here is the complete information of what I need to do:
I need to place text on an image with the following specifications:
first and second line is 7 point futura book with leading set to 11 points and tracking set to 10 points.
3rd line is 8 point trajan bold with 12 point leading.
4th line is 8 point trajan bold with 12 point leading, but word at the end has first letter as 6 point and the rest at 5 point.
5th and 6th lines are in 6 point futura light with leading set to 9 point and tracking set to 5 points.

I found a resonable rtf to image converter. I am testing that now.
troyd1
Posts: 73
Joined: 2007-07-29T17:13:19-07:00

Re: different fonts in the same caption

Post by troyd1 »

I have came up with an excellent solution. I found a program call text2image.exe. It will convert an RTF file to many image formats. The website for this is http://www.xuebrothers.net/. The price was only $9.99. They have a lot of other neat program also.

Troy
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: different fonts in the same caption

Post by anthony »

There you go. Though for RTF to Image there should be free solutions available too. Most mail programs will need to be able to do things like this any way.

Of course if you are drawing text directly as they show in some of the examples, then IM can do that too, using the -annotate operator. See IM Examples, Text to Image, Annotate
http://www.imagemagick.org/Usage/text/#annotate

You may also like to look at 'Fonts' for examples of generating interesting font effects from simpler fonts.
http://www.imagemagick.org/Usage/fonts/

It all depend on what your source and skills are.

There are lots of ways to skin a cat, and what method you use depends on what you want that skin for, and how messy you like the results!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply