burghoff / Scientific-Inkscape

Scientific Inkscape: Inkscape extensions for figure resizing and editing
528 stars 20 forks source link

Add option to choose the text box boundary when running homogenizer #18

Closed m-beau closed 1 year ago

m-beau commented 1 year ago

Hi,

Thanks for this awesome tool!

I encountered a quite annoying behaviour of your homogenizer: it always uses the centre of the bottom edge of text boxes as a reference when scaling texts up or down. However, in most cases, this ends up being wrong: if a text is a y axis label, the correct reference if the center of the right edge; if it is a x axis label, it is the centre of the top edge etc.

This behaviour makes the homogenizer impractical, as it forces you to manually re-align every single figure axis label when you use it.

Would it be possible to either add an option in the homogenizer menu to be able to chose the text box reference point? Or, better, use inkscape's expected reference point, based on the text-box alignment (center of bottom edge if centered, of left edge if left-aligned, of right edge if right-aligned)?

Thanks!

m-beau commented 1 year ago

Here is an example of such behaviour (text boxes are left aligned, so the reference point should be the center of the text boxes left edge): Before running homogenizer: Screenshot from 2023-08-04 00-34-19 After running homogenizer to increase the text font: Screenshot from 2023-08-04 00-35-34

burghoff commented 1 year ago

Are you using the latest release? I think I changed it to maintain the center in v1.3.0.

Edit: Oh never mind, you're talking about the anchor point. I thought you were talking about the vertical position. v1.3.0 did modify it to use the center position, both vertically and horizontally.

burghoff commented 1 year ago

I have been thinking about changing the position based on alignment, so I'll definitely consider it. (Personally I tend to pre-Flatten and center-align everything.)

By the way, in case you didn't know the latest release also adds Plot-Aware Homogenizing, which does some of what you want. If you change the font size of text near a plot, it scales the distance to the plot also. See below.

APL_fig

m-beau commented 1 year ago

Waw that's awesome! Sorry for missing the latest release - I'll give it a go, thank you so much!