Help with odd font bounding box

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
nathanziarek

Help with odd font bounding box

Post by nathanziarek »

I am attempting to use a decorative font (Type Embellishmnt One LET) but it is not contained on the canvas. I am looking for some help thinking through this problem.

I do not have access to any APIs. I have read the Usage examples (I am using IM6.3.3, and the LokiCola example seems to show that IM gets the bounding box of oddball fonts) but can't seem to get this particular font to work.

Essentially I'd just like a large (1000x1000) "letter" on a canvas. I've played with draw and annotate, and can get individual letters to work by adjusting their position on the canvas, but as each seems to have a wholly unique bounding box, I was hoping for some method that was more automated.

I appreciate any suggestions...

Nate
nathanziarek

Re: Help with odd font bounding box

Post by nathanziarek »

Found it...Anthony's site once again comes to the rescue.

search for: Automatic Sizing of Generated Font Images on the page http://www.imagemagick.org/Usage/text/

worked really well, although not with a ton of precision.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Help with odd font bounding box

Post by anthony »

Also Im will try to auto size a font to fix a specific image size.
For this you specify a size for the image, but not a point size

Code: Select all

   convert -size 1000x1000 -font Ravie -gravity center label:H  large_h.png
IM actually does this by trial an error for the pointsize needed, especially for the caption: variant.

Hmmm actually it gets this wrong for a bad font like LokiCola with part of the image drawing outside the 'left' bounding box. But for most fonts you should work well.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply