Hi,
Need help with the following:
1.
I need to convert the following string to a bmp image:
"Hello World".
The spacing between the words "Hello" and "World" needs to be 20 pixels. How do I accomplish this spacing using MagickWand?
2.
I need to display the text "Hello" with the rightmost end at a distance of 20 pixels from the right edge of the image. Any ideas on how to do this using MagickWand?
Thanks!
Cathy.
How to find text length in pixels?
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: How to find text length in pixels?
The MagickQueryFontMetrics(mw, dw, text) function returns metric information for the given text string from which you can compute where the strings should be placed.
See my fontmetrics example.
Pete
See my fontmetrics example.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to find text length in pixels?
For command line see..
Determining Font Metrics, without using an API
http://www.imagemagick.org/Usage/text/#font_info
Determining Font Metrics, without using an API
http://www.imagemagick.org/Usage/text/#font_info
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/