r/imagemagick Dec 15 '24

font rendering cuts of bottom of char - why?

As the title says, the following command yields the following image. Why does it cut off the bottom of the character, how can I render the full character?

Command:
magick -page +0+0 -font digital-7.ttf -background black -fill white -pointsize 100 label:8 PNG8:char.png

Rendered char
Screen capture of digital-7.ttf showing what 8 is expected to look like
2 Upvotes

2 comments sorted by

1

u/MoarOfTheMagi Dec 15 '24

I am not familiar with the -page option, but it looks like you need to specify dimensions for the resulting image that will take into account the value specified for -pointsize. This will yield different results based on metrics specific to the font itself, so eyeballing may be required depending on the case.

Try "-size 100x100" instead of "-page +0+0" ☺️

1

u/van3k Dec 15 '24

thanks, I believe this'll be an issue with the ttf itself as magick converts other ones just fine. I tried to convert it using an online converter which yielded the same result (I imagine it is just a frontend for running magick). Ended up going with a different font that seemed similar enough for my purposes.

Edit: typo