Square pegs fit into round holes 3: Enter Illustrator

At the conclusion of the previous blog post I’d hinted that the ‘Square Peg Round Hole 2” technique was possible outside of InDesign in other design applications. In this post, I’ll explain how this can be implemented in Illustrator, as well as some bonus techniques that behave in a similar way.

Déjà vu?

I’m going to do the same few initial steps that I did from the previous article, so if this seems like Déjà vu, that’s why. If you are familiar with how this worked from last time and want to see the specific Illustrator differences, skip through until the heading “The Plot Thickens”. However, if you are learning of this technique for the first time, here is the best place to start.

Setup the Illustrator File

Within a new Illustrator file, I have a name-badge design that will contain the names that will vary in character length and point size. For the varying sizes of the type, I’m going to use three different sizes for the following character lengths:

  • Four or less characters;
  • Between five and eight characters; and
  • Nine or more characters.

I’ll change the document so that there are now four layers:

  • The static background with the graphic, being the lowest layer;
  • A copy of the name on a layer called 4 less;
  • A copy of the name on a layer called 5-8; and
  • A copy of the name on a layer called 9 more.

Hiding layers 4 less and 5-8, I’ll go to the 9 more layer and type the letter M 9 times to make sure it fits.

Satisfied with this, I’ll hide this layer and turn on 5-8 and type the letter M 8 times to make sure it fits.

Again once I’m satisfied, I’ll hide this layer and turn on 4 less and type the letter M 4 times to make sure it fits.

If I turn on all text layers at once, it doesn’t make much sense.

That’s fine for now. Onto the next portion of the technique.

Set up the database

As stated earlier, this technique requires additional fields in the database. Let’s look at the database first.

From here, three more columns need to be added, and they are given names that will identify them easily once back in the InDesign file, specifically:

  • name1-4
  • name5-8
  • name9

In the blank cell underneath the field name “name1-4” and to the right of the first name (Cell B2 of this example) I’m going to add the following Excel formula:

=IF(LEN(A2)<=4,A2,"")

This formula breaks down to the following:

If the contents of this cell are less than or equal to four characters in length, take whatever was in cell A2 and repeat it here. If not, leave the cell blank.

Upon pressing enter, nothing happens.

That’s intentional and working as designed. In this example, the word Sophia is six characters, so the formula is behaving as expected.

In the blank cell underneath the field name “name5-8” and to the right of the formula that was just created, I’m going to add the following Excel formula:

=IF(AND(LEN(A2)>=5,LEN(A2)<=8),A2,"")

This formula breaks down to the following:

If the contents of this cell are between five or eight characters in length, take whatever was in cell A2 and repeat it here. If not, leave the cell blank.

Upon pressing enter, the name Sophia now appears in the cell.

Again, everything is going to plan. Because the name Sophia is six characters long and fits the rule that it is between 5-8 characters long, it appears in the cell.

Lastly, the blank cell underneath the field name “name9” and to the right of the formula that was just created (that now has Sophia in it) I’m going to add the following Excel formula:

=IF(LEN(A2)>=9,A2,"")

This formula breaks down to the following:

If the contents of this cell are more than or equal to nine characters in length, take whatever was in cell A2 and repeat it here. If not, leave the cell blank.

Upon pressing enter, nothing happens.

Once again, this is completely expected. This row is now behaving correctly and having the name only appear in the column that relates to how many letters it contains.

I then copy the cells B2 through D2 all the way down the database and watch the rest of the database populate, with the names now appearing in their appropriate columns.

The plot thickens

I’ll then save this excel file, but importantly will also save it as a CSV file so it can be used in Illustrator to make the variables. Unlike InDesign, Illustrator as shipped can only accept either CSV or XML for the data.

Back to the Illustrator File

Time to add the variable data. To do this, I’ll go to the variables panel and from the hamburger icon in the top right hand corner, I’ll select Load Variable Library…

From the navigation panel, I’ll select the CSV created from Excel and click the Open button. Once I do that, I can see that the variables panel now has populated the variables with the field names from the header row.

Make the static fields variable

The fields are now loaded, so it’s time to apply the variables to the placeholder text of Ms. I’ll start with the four letter type and layer, and turn off the visibility of the 8 and 9 letter layers so that they aren’t visible. I’ll select the type with the black arrow tool and from the variable panel, I’ll click on the name1-4 field and then from the hamburger menu, select Make Text Dynamic.

I’ve done that, but everything looks the same. The only difference is that in the variables panel, the MMMM characters appear beside the variable on the objects column.

That’s because the preview works differently to InDesign. I’ll go to the Data Set dropdown field at the top of the variables panel and select a data row that I know contains a name that will be four letters long, in this case Data Set 11.

I can now see that the MMMM in the objects column of the variables panel has now changed to the appropriate record. Excellent.

Time to do the next layer.

I’ll turn off the visibility for name1-4 layer but turn the visibility on for name5-8 layer. Again, I’ll use the black arrow tool to select the type, then select the name5-8 in the Variables panel, and from the variables panel hamburger menu, select Make Text Dynamic.

Just like last time, everything looks the same. The only difference is that in the variables panel, the MMMMMMMM characters appear beside the variable on the objects column.

Just like before, I’ll change the Data Set dropdown to a record that has a name that I know contains between 5-8 letters, namely Dataset 1.

I can now see that the MMMMMMMM in the objects column of the variables panel has now changed to the sub-layer name. Different behaviour to the previous field, but perhaps it’s a glitch? No, it adopts the name of the sub-layer, rather than the type it replaced.

Let’s apply the variable data to the last layer. I’ll turn off the visibility for name5-8 layer and turn on the visibility for name9 layer. Again, I’ll use the black arrow tool to select the type, then select the name9 in the Variables panel, and from the variables panel hamburger menu, select Make Text Dynamic.

Just like last time, everything looks the same. The only difference is that in the variables panel, “name9” appear beside the variable on the objects column.

Just like before, I’ll change the Data Set dropdown to a record that has a name that I know contains 9 or more letters, namely Dataset 71.

I can now see that the type in the objects column variables panel has now changed to the field name. Just like the last field change, the sub-layer name now appears in the objects column of the variables panel, and the name in the art has changed to Franciska.

Putting it all together

I’ll now turn all layer visibilities on and navigate to three records in a row that I know change to either a less than four letter; between five-eight letter; or nine or more letters long name, so Data Sets 114-116

Bonus Method – Envelope Distort

Another way that only uses one layer is to use Illustrator’s Envelope Distort effect. To demonstrate this, I’ll duplicate the name9 layer, hide the other layers besides the base, and apply the first_name  variable from the Variables panel the same way the other variable data was applied.

Then, I’ll draw a rectangle with no fill or stroke above the variable type.

Then with my black arrow tool, I’ll select both the text and the rectangle and from the Object menu, I’ll select Envelope Distort, and then Make with Top Object.

Upon doing this, I can see that the result looks pretty good!

But upon going through the records with longer names, looks a little distorted.

But there’s no reason that the envelope AND the initial method shown in this post can’t both be used at the same time!

Bonus BONUS Method… sort of – Dynamic Text

At the time of writing, this method only exists in the Illustrator Beta version… but knowing Adobe MAX is only a month away, it’s likely that this feature will be carried on to future versions.

I’ll open the file that used the Envelope technique using Illustrator Beta. Once open, I’ll select the object with the envelope distort, and from the Object menu, I’ll select Envelope Distort, and then Release.

I’ll delete the rectangle and just click on the type with the black arrow tool. From here, I can either use Illustrator’s floating (and annoying) contextual panel and click the Dynamic Text icon; or go the long way and go to the Type menu and select Convert to Dynamic Text.

I can now size the type to my desired size. While I’m here, I’ll also change the name of the sublayer to “make me variable!” to demonstrate what was pointed out earlier. I’ll then click on the type with the black arrow tool, click first_name in the Variables panel and click the Make Text Dynamic button.

We can now see that this type is a variable, and the object column has indeed adopted the name of the sublayer.

Unfortunately, there is one drawback to this feature, and that is its inability to centre the type vertically.

This feature is better at handling the square peg/round hole issue over multiple lines though, but does need work concerning its overall alignment as the following examples show using the one set of data, and two dynamic text frames of the same size for each example.

Luckily, anyone using the Beta can provide feedback while the feature is still in testing.

I want it in InDesign

Wish this existed in InDesign? So do I, but the only way the InDesign developers are going to know is if you vote for it here!

Really make it pop

Unlike InDesign, Illustrator lets you apply some very creative effects to live type that InDesign just cannot do. As a result, more realistic looking effects such as this neon type can be made variable.

You are limited by your creativity here. I’d learned about Graphic styles at 2024’s Creative Pro Week in Washington DC at Laura Coyle’s session. Definitely check out her Youtube channel, particularly this one to start with about shadow letters.

Otherwise, if you need pre-made graphic styles, they are only a Google-search away, and also available from Adobe Stock.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.