This week we’re revisiting the Align Outline Text script from LDC #41, to show how an existing script can be expanded upon to add new functionality. The original version of this script made a set of assumptions, which means it works really well for our sample test file, but there are many other cases where these assumptions are false, and the script doesn’t do anything to fix our problem. The original purpose was to examine paragraphs, try to identify the lead-in text (the “(a)”, or “1.”, or “Section 1.”, etc), and wrap it with a <FONT> tag with properties to cause it to render with a fixed width instead of relying on non-breaking spaces to make it appear spaced. Instead of looking for a very specific type of spacer, like the last script did, we can use the Word Parser in Legato to step through the lead-in word by word, examining each one, to determine how many characters appear before the first set of non-breaking spaces. This is a lot more flexible, and lets our script react better to unforseen types styles of paragraphs.
Continue reading "LDC #48: Improved Align Outline Text Function" »