sky-chaser-high / adobe-illustrator-scripts

This is a collection of scripts for Adobe Illustrator.
MIT License
80 stars 7 forks source link

justifyContentSpaceBetween.js works wrong, if a text is already has custom tracking #6

Closed gchegr closed 9 months ago

gchegr commented 10 months ago

Try to select a point type text with some tracking already applied and a larger line together, run the script. The result does not match the line’s length. It looks like the script does not reset tracking before measuring the width of it.

sky-chaser-high commented 10 months ago

Hi gchegr. It does not compare the number of characters and align to the one with more characters. It compares the current width including tracking and aligns to the longer text.

gchegr commented 10 months ago

Perhaps I phrased it wrong. Here is a demo. justify_test As you can see, if I try to adjust tracking with the script for the text that already had it modified, the result is way off.

creold commented 10 months ago

If you run the script again on the same point text, you would expect the size to match again. This would be predictable to the user. 2023-10-27 10 13 28

sky-chaser-high commented 10 months ago

I guess I was mistaken. My apologies. I was able to confirm it here as well. I'll fix it.

sky-chaser-high commented 10 months ago

Upon investigation, it appears that the behavior is incorrect when kerning is set to Auto. I didn't notice it in the Japanese version because it worked in Auto. Modified to set kerning to 0.

creold commented 10 months ago

I think it works well right now.

gchegr commented 10 months ago

Confirm it is fixed.