Copy link to clipboard
Copied
ABCD Name
AD Name
ABD Name
I need to align the three above.
Some people may use grids, but that feature is difficult to use and I usually don't use it. It's better to use font spacing.
However, it is troublesome to adjust the font spacing. For example, when the font size becomes larger, I have to try every Letter spacing value.
Just want to ask: What is the relationship between font size and spacing, can we calculate it?
Hi @dublove5CFE, the issue here is converting tracking units (which I assume you are using to space out the A in the second line) into ruler units. Tracking is measured in em units which relate to the font size. The conversion factor is, 1000 / font size. Some fonts have differing sized em squares but Indesign seems to calibrate them all to 1000 units in terms of the UI and scripting API. You can see how it works in this script, that attempts to solve your problem.
/**
* Letterspace Chars T...
Hi @dublove5CFE, I have written a modified version that also sets the tab stop so that the tab character width is 5mm (you can adjust this in the script). I've also put the letterspacing into a function so it can be used for other purposes.
Try this version and see what you think.
- Mark
/**
* Letterspace Chars Before Tab
* Script expects to have a text selection that includes
* paragraphs that share a tab stop, and will and will
* adjust tracking of characters before the tab character
*...
Hi @dublove5CFE, it sounds like it might be better in your case just to replace the tab with another character of your choice. Here is a re-write of the script that replaces tab with em space u+2003. You could choose another unicode space character.
- Mark
/**
* Letterspace Chars Before Tab
* Script expects to have a text selection that includes
* paragraphs that share a tab stop, and will adjust
* tracking of characters before the tab character
* so that the last characters before each ...
Thank you Robert.
Copy link to clipboard
Copied
No problem, I've added code that will ignore the colon (not space it out). - Mark
Copy link to clipboard
Copied
2024.6.15 version
about":"
It doesn't seem to change?
Did you miss something?
There is no tab behind ":".
":" is a full -bodied character, occupying a word width
Copy link to clipboard
Copied
Copy link to clipboard
Copied
There is no tab behind ":"
Copy link to clipboard
Copied
@dublove wrote:
There is no tab behind ":"
So the code won't work:
for (var i = paras.length - 1; i >= 0; i--) {
match = paras[i].contents.match(findFirstTab);
It expects TAB somewhere in EVERY paragraph.
Copy link to clipboard
Copied
This is actually two situations:
Situation 1, aligned to the longest position ".:"
Situation 2, alignment to the longest position ".\t"
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I now use another method.
After all processing,use regular search (~ K) (\ t) (~ K) to replace it with: $ 1:$ 3
Find more inspiration, events, and resources on the new Adobe Community
Explore Now