Hi there,

Great module - am using it to dynamically add captions using the text action, however there is one issue. The positioning of the text is based (as far as I can tell) on the base of the text, rather than the baseline, and therefore has a different position if there are y,g,p,q,| charachters etc. (anything with tails). Is there anyway to make all text justified the same so that my captions are all in the same place?

Thanks,

Adam

Comments

dman’s picture

That's a problem I've seen in tests, but don't have an answer for.
The current method is - draw the text, find its bounding box, align that. I treat the rendered text as a graphic element.
So yeah, you get variable results with descenders!

The real way - using GD and its baseline-positioning dimensions meant that I needed to juggle a lot more numbers. See, supporting ROTATION in the mix, along with borders and shadows meant it was all-but-impossible to figure out how to really align something bottom so it would always clear correctly.

I think the only way will be to allow a position:absolute sort of override - though that was only going to work with fixed-size images and my alignment effects would be ignored. You can get that by using top+400 instead of bottom-10. Probably.

dman’s picture

Image rendering library is being revamped in 6.x-2.x-dev
I expect to put a line-height into that, as it's now got word-wrapping and more to do

dman’s picture

Status: Active » Closed (won't fix)

Meaning, I'll retire this issue from here maybe revisit it on imageapi_text

bkosborne’s picture

Hmm any word on this? Proving to be quite a problem on my site now...