is now part of CreativePro.com!

*** From the Archives ***

This article is from February 19, 2008, and is no longer current.

How to apply kerning as a character style

14

It’s always frustrated me that kerning doesn’t show up in the character style dialog box as a field that I can enter a specific amount.

I often want to apply kerning to a specific glyph as part of a character style which could then be part of a Find/Change routine.

But how can you make a character style that contains a specific kerning amount?

Turns out, you can trick InDesign into doing something it doesn’t want you to do. (Or maybe it does want you to do it, but it wants you to work hard to do it.)

First, place your insertion point between two characters and kern the amount you want.

Then select those two characters and click to define a new character style.

Look at the summary of the character style definition. The character style lists the kerning amount as part of the character style definition, even though you can’t actually set that kerning amount in the basic character formatting!

From that point on, it’s pretty simple to use the character style whenever you want to apply kerning.

Sandee Cohen is a New York City-based instructor and corporate trainer in a wide variety of graphic programs, especially the Adobe products, including InDesign, Illustrator, Photoshop, and Acrobat. She has been an instructor for New School University, Cooper Union, Pratt, and School of Visual Arts. She is a frequent speaker for various events. She has also been a speaker for Seybold Seminars, Macworld Expo, and PhotoPlus conferences. She is the author of many versions of the Visual Quickstart Guides for InDesign.
  • You’re promoting a bug, Sandee, which means that when Adobe gets around to fixing it your trick will break — on the other hand, they haven’t gotten around to it for quite a few releases, so I guess it’s pretty safe.

    Why can’t you use tracking to achieve (almost) the same ends? Granted, not using tracking opens the door to later applying tracking as a local override.

    Tracking is supposed to be applied to a run of text, but if you define tracking as part of a character style and then apply that character style to a single character, the insertion point after the character is, in effect, kerned by the amount of tracking called for.

    Dave

  • I’m not convinced this is a bug, Dave. Why do you think so? The character style Summary is clearly set up to capture and record the formatting. For example, it says: “[None] + pair kern: -40”. Seems very non-buggy to me.

    I think it’s cool. Yes, tracking would give you a similar effect. But sometimes knowing how to trick InDesign is key to getting the job done!

  • There’s a bug there somewhere. You can’t have a feature of an entity that is ignored by the dialog box that defines the entity.

    I first discovered this back in CS days (I think) when I was first working on my Text Style Reporting script. I recall reporting it and getting an acknowledgment back that this was indeed buggy behavior.

    The thing is that kerning applied this way overrides the kerning either built-into the font or calculated by the Optical algorithm while tracking is incremental. If you limit yourself to using such a style only for certain characters, then I suppose it doesn’t matter.

    Dave

  • By the way, you can do the same thing with a paragarph style. Apply manual kerning to a pair of characters and with your insertion point still between the two character, redefine the paragraph style.

    Now I think about it, it’s not entirely true that the dialog ignores the setting (it does of course include it in the summary). You can reset it along with all the other settings by using Reset to Base.

    Dave

  • Dave,

    I don’t think the behavior is a bug. It is, as so many engineers will say, simply an “undocumented, and non-supported feature.”

    However, I know that as a scripter you are very sensitive to those areas where InDesign does something that may or may not be supported in a script. As you mentioned in the ID User forum, inserting a snippet as an inline object could cause a crash when part of a script, although it doesn’t do so when part of an ordinary File > Place action.

    I often think of your scripts as the canaries in the cave for bugs in InDesign. If something is in the least bit buggy, trying to do it in a script will cause a crash in InDesign.

    However, often times the same behavior is OK for us normal folks using the program manually.

    Meanwhile, regarding using tracking instead of kerning, I originally felt that using tracking, instead of kerning, wouldn’t work if you also wanted a tracking amount as part of the paragraph style. (Anne-Marie mentioned this to me in a private e-mail.)

    However, after some testing, I am starting to think that tracking is just fine.

    So, despite the trick being very clever, I think it may not be as necessary as I originally thought.

  • Katie says:

    I was curious how to add space around a character with a character style, but I’m not sure if this is a solution. I am making a page that uses exponential numbers and I have the exponent style to be superscript, but the superscript number sits too close to the base number. Is there a way to add space between the character-styled and non-character-style numbers? Tracking in the character style doesn’t fit my needs since I need the space before the character style. Any other suggestions? I don’t want to manually insert a thin space in every instance if I don’t have to.

  • mchak says:

    Well, Dave and Sandee – to update an old discussion – it appears that Adobe has indeed “fixed” this “bug.” It no longer works in CS 5 or 5.5.

    You can, of course, apply tracking to 1 character (the W in We for instance) via a character style, but if you want to apply the char style via a GREP style, it’s not so easy. You can’t instruct a GREP style to search for We and only apply the character style to the W. Or can you?

    I know you can do it via GREP find/change, but I’m looking for a way to add it to a GREP style, the way I used to be able to do with kerning in CS4.

  • @mchak: Sure you can apply the character style to just the “W” by using a positive lookahead or positive lookbehind. For example, to kern between any letter that is followed by the letter “i” you could use: \w(?=i)

  • Mike Rankin says:

    I believe the lookahead/lookbehind will only work when the characters have the same formatting. For example, you couldn’t use it to kern between an ital character and a regular period. That was my “GREP gripe” in this post: https://creativepro.com/a-little-grep-gripe.php

  • Pesto DaCat says:

    Genius – been looking for this solution for a long time!

  • Morteza Farhoudi says:

    Hi there,
    I want to capture ‘Superscript’ as a character style, but I couldn’t figure out how to do it. Any help would be appreciated!
    Thank you!

  • Pavla Hernandezová says:

    Hi there, are there any updates on how to get a specific number in the kerning field within a character style while the tip is not in the latest version?

  • >