is now part of CreativePro.com!

Applying Expert Fonts to Numerals with Nested Styles

9

Nathan wrote:

We use a font that has a SC (small caps) version and in our Body copy (which is regular) we would like all the numbers to be SC. Is there a way to use nested styles to change all the numbers to a different font or different character style inside a paragraph?

Nested styles are tricky little beasts, and at first glance it may appear that you can’t get what you’re looking for. But have faith! Depending on how your numbers appear in the text, you might be able to pull it off.

In this example, I have assigned the Type 1 Utopia font to some text:

expertnested1

Utopia has an “expert font” that includes the old style numerals, small caps, and so on. If I apply Expert to the whole story, I get the oldstyle numbers, but the rest of the text is a disaster:

expertnested2

So I’m going to set up nested styles in my paragraph style, so that no character style is applied up to the first instance of a digit. Then the “oldstyle numbers” character style (which I created earlier, and simply applies the Expert style) will go on until the first space character. There is no “space character” available by default, so I just clicked in the area on the right column then typed a space character (which is invisible in the image below).

expertnested3

Finally, I made a third nested style rule and set it to Repeat. (This is a new CS3 feature. If you have CS2, you’d have to repeat the previous two rules manually a bunch of times, which is annoying.)

The result works great!

expertnested4

Of course, this nested style fails if the digits are part of a word (L8R) or don’t end with a space character (7-Eleven), or several other problem areas. But in most cases, it’ll work just fine.

Now, I would be remiss in my duty if I didn’t also add that it may just be time to upgrade your fonts to OpenType versions, which may have expert or SC fonts built in. That’s so much easier to deal with! But in the meantime, nested styles may work for you.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Eugene says:

    Very nice, that’s how I would have done it, back in CS2 I had to do a find replace for anything like that, even then it wasn’t that accurate.

    In CS3 I have also used the GREP to find such things and replace them, but it’s not an automatic style.

    Although I do have an issue with the Nested Styles. Perhaps there is help to be found here.

    Is there a way to have 2 sets of nested styles in the one paragraph style.

    For instance, I would perhaps do the above, and achieve the number styles. But for printing monetary values in Euro it needs the ? symbol. I have a ? key on the keyboard, that doesn’t rip correctly leaving a blank square where the ? symbol should be, I have to use a specific font.

    I have achieved this with the above method, but my problem lies where I would already have nested style running in a paragraph, perhaps after a full colon, changing from bold to roman, then half way through the sentence I would have a monetary value like, ?485.50.

    I notice in the Nested Style Menu (that is ever so small) that you can keep adding in stuff after the repeat, but I can’t get another thing to happen, is there a way to get both nested styles in the same paragraph style, or is find and replace the only option in that instance?

  • Greg Mouning says:

    Hi David,

    After reading your post called, “Applying Expert Fonts to Numerals with Nested Styles”, it occurred to me that I could do something similar to create ordinals. For example, I am using a font which doesn’t produce the superscripted nd, st, th that follows numbers. Is this something I might easily with Nested Styles or should I use the CS3 GREP function combinded with Find/Replace? Thanks in advance for your reply.

    -Greg

  • Greg, I think you’ll need to use Find/Change to do that (perhaps with GREP) because nested styles can’t search for a string of 2 or more characters — nested style rules can only look for a single character (such as “a digit,” “a comma” or whatever). So you can’t add “nd” or “st” into a nested style rule.

    Eugene: That is strange (that nested styles lets you apply more rules after the Repeat). I can’t think of any way to break out of the repeat, or to apply 2 or more sets of rules to the same paragraph. Too bad.

  • Martin Braun says:

    Nested Styles are great, but I would hope to search for end-patterns in more flexible ways. I sent a feature-request to Adobe for grep-style searchpattern in nested styles several weeks ago.
    I do not expect that they hear my wish, but it would be so cool…

  • sivakumar says:

    It was amazing to see this site

  • John Driscoll says:

    David, you say above that a nested style rule can look for a character, such as a comma. How would one set up a rule to look for a comma?

  • Please note that in CS4, you can just use GREP Styles to apply a different font to all numbers. It’s the easiest trick in the book! (The default grep style that shows up when you first click New Grep Style is \d+ which means “one or more numbers.)

  • What to do if some of the numbers end with a dot or a comma?

    Like the Norwegian date format: 13. mai 2009

    Or the Norwegian way of pricing items: 2900,-

    Thanks!

  • Dono2000 says:

    I love it. Used in combination with OpenType and SC to format a menu.

    Lovely

  • >