is now part of CreativePro.com!

Easy Diacritics and Other Tough Glyphs

17

In an earlier post I presented a workaround for entering non-native language diacritics (like the grave accent in à la carte) by using InDesign’s built-in spellchecker, which can add them for you. It’s a slick solution, but it requires some set-up — you have to enter a word incorrectly and have InDesign correct it.

I recently learned of a better way to insert any difficult glyph into the text flow, correctly, on the fly: Peter Kahrel’s compose.jsx script for Adobe InDesign or InCopy (Mac/Windows, CS2/CS3, donationware — download instructions are at the end).

His script lets you combine any letter with any accent or diacritic using simple mnemonics – no arcane codes to remember, no need to open the Glyphs panel. If the combination exists as an actual glyph in the typeface, it inserts that; if not, it automatically enters both glyphs and then intelligently kerns them in so it looks like a single glyph. And he threw in a few more features, which I’ll get to in a bit.

How it Works

You need to double-click the compose.jsx script in the Scripts panel (Window > Automation > Scripts) every time you want it to help you enter a letter/diacritic combination. If you’re going to use the script more than once or twice, you might as well assign a keyboard shortcut to it from Edit > Keyboard Shortcuts. That way, entering tough glyphs is a completely mouse-free operation.

When you run the script, a little dialog box appears:

The shortcut for opening up the script’s Help dialog box is highlighted by default. You can press Return/Enter to open that (I’ll show you what you get in a second) or just enter your letter-plus-accent/diacritic combo to replace the contents of the field.

For example, if I type the letter “o” and follow it with a doublequote…

… and hit Return/Enter, I get an “o” with an umlaut in my text, matching the typeface and style of the text surrounding my insertion point:

1compose-hero.gif

Entering “o^” gives me an “o” with a circumflex; “o,” (note the comma) is an “o” with a cedilla, and “ov” is an “o” with a caron (hacek):

1compose-heros.gif

I could have entered any character followed by the mnemonic code, not just an “o”. As I said, if the actual combined diacritic doesn’t exist as a glyph in the font, the script enters the two glyphs and then kerns them in. That’s what happened with the second and third combos, the cedilla and caron, above. Only the first one, the o with the circumflex, is an actual glyph in the typeface I used (Myriad Pro). The entire cheat sheet of mnemonics (e.g., comma = cedilla) is in the script’s Help screen:

1compose-cheats.gif

More Tricks

Actually, that cheat sheet is not the main help screen, this is:

1compose-fullhelp.gif

Selecting the first radio button, “Single character for accent (show list)” and clicking the OK button generates the list of mnemonics above. The other radio buttons exist as more of a guide — you really don’t need to select them to invoke them.

For example, one says “Enter four-character unicode to insert a character by its unicode value.” You don’t actually have to choose the radio button to make that work — entering a four-character unicode in the initial Compose field works from the get-go. Neat!

So do the other tricks that Peter threw in: Enter any character followed by a “g” to enter the Greek symbol for that letter, or just enter a backslash (\) all by itself, and the script kerns (overstrikes) the two characters preceding the insertion point.

Download and Install

To get the compose.jsx script for InDesign, first go to Peter’s InDesign Scripts Intro page for download and installation instructions. Then from his page of InDesignScripts, click the one called “Enter/Create Accented Characters” or go directly to it here. That brings you to a description page for the compose.jsx script, which has a link to the script itself at the bottom.

I needed to make a slight change to the script so it works with InCopy. You can download it here: ic-compose.jsx. But InCopy users should still go to Peter’s pages above for install instructions and information on how to use the script.

This is a very cool script! If you find it useful, please be sure and send a few bucks Peter’s way (the link is in his introduction) as a donation to support his continued scripting efforts.

Anne-Marie “Her Geekness” Concepción is the co-founder (with David Blatner) and CEO of Creative Publishing Network, which produces InDesignSecrets, InDesign Magazine, and other resources for creative professionals. Through her cross-media design studio, Seneca Design & Training, Anne-Marie develops ebooks and trains and consults with companies who want to master the tools and workflows of digital publishing. She has authored over 20 courses on lynda.com on these topics and others. Keep up with Anne-Marie by subscribing to her ezine, HerGeekness Gazette, and contact her by email at [email protected] or on Twitter @amarie
  • Jennie says:

    That is a very useful script. I checked out Peter Kahrel?s site as you suggested. I cannot wait to try his tablesort script. I was wishing for something like that this morning! Thanks!

  • Igor Freiberger says:

    For Western languages, the easier way to insert diacritics is to set up the keyboard to US International (under Windows). This will let one type ,+c to get cedilla, ‘+a to get á, “+o to get ö or `+e to get è. Much less work than use this script (although it’s surely useful).

    International keyboard is enough to write on any Western language, even Scandinavian ones. One will get trouble just with Polish, Magyar, Turkish and cyrillic-based languages, as Serbian or Bulgarian.

    Another solution is to set up the keyboard itself. Microsoft offers a Keyboard Editor for free. So you can attribute key combinations as AltGr+[letter] to reach any diacritic and save this as a keyboard setup.

    I myself type much faster on a HP Pavilion with a customized International keyboard using several AltGr combinations I built with this MS tool.

    Probably there is a similar resource on the Mac side of the world.

  • erique says:

    I agree, Anne-Marie, this is a *very* cool script! Thanks for drawing my attention to it and to Peter’s other interesting looking scripts.

  • Peter Kahrel says:

    Igor,

    I mention on the script’s page that if you write in a single language or maybe switch between two languages, you’re better off using dedicated keyboards. But there is no usable single keyboard layout that gives you (relatively) easy access to Turkish, Bulgarian, Spanish, Vietnamese, etc. Furthermore, there are no keyboard layouts that let you enter characters that don’t exist (except maybe in Wonderland). The script is precisely for that.

  • Ir says:

    Nice script, but not very useful for cyrillic (kerning is not well adjusted) and greek (you cannot enter a char with a diacritic in the language that makes most use of diacritics and often requres more than one on a singe character) – exactly what I use…

  • Thanks for this tip Anne!

    Its pretty easy to do with the script!

  • Don Ayer says:

    It looks like Peter has updated the script and the updates have made incompatible with InDesign CS2. I downloaded your InCopy version of the script and changed “#target incopy” back to “#target indesign” and it seems to work great!

  • Andy says:

    For rare diacritics (ie weird phonics), the easiest I’ve found is to work with the font. Using something like FontCreator, open the font and add a glyph, copying pieces from other glyphs. Check the font license though.

  • Marek J says:

    Very very very very cool! Just saved me a TON of time! Thank you for describing this.

  • Kevin says:

    I can’t seem to get the compose script to work with my InDesign CS4 for windows.

    I have followed you instructions but when I run the script nothing happens.

    Please help, I am currently working with several hundred pages of Polish text and this would save me a lot of time if I can get it to work.

  • Kevin, I just want to make sure: You have the text cursor flashing inside a text frame, right?

  • Very good article! I like it very much!

  • Working on Istanbul Architecture in InDesign CS3 (Mac) set in Rotis Sans Serif (part of a series in English but with addresses, buildings and some building terms also in Turkish), this post saved my life. Thank you Anne-Marie Concepcion for pointing me in the right direction. I was still having trouble with a cap I with a dot above. Our author reckoned that my amateur solution of an i at 125% of vertical scale looked odd. He was dead right. I emailed Peter Kahrel and he helped me find a way. In the ‘help’ dialog box of his script you type in I and a full-stop and press return (enter) and it works like magic. PK I owe you.

  • Working on a href=”” titleIstanbul Architecture=”” in InDesign CS3 (Mac) set in Rotis Sans Serif (part of a series in English but with addresses, buildings and some building terms also in Turkish), this post saved my life. Thank you Anne-Marie Concepcion for pointing me in the right direction. I was still having trouble with a cap I with a dot above. Our author reckoned that my amateur solution of an i at 125% of vertical scale looked odd. He was dead right. I emailed Peter Kahrel and he helped me find a way. In the ‘help’ dialog box of his script you type in I and a full-stop and press return (enter) and it works like magic. PK I owe you.

  • Peter Kahrel says:

    Ir,

    I saw your comment on Cyrillc and Greek just now (a year and a half after you posted). I do have a version for classical Greek, but never posted that because I didn’t think there was much interest in it. You’re welcome to it, so drop me a line if you want it.

  • ???? says:

    I like to disseminate knowledge that I have accumulated with the calendar year to help improve group performance.

  • Mike Rankin says:

    To reduce spam, comments have been closed for this post. If you want to start a related discussion, head over to the Forums and create a new topic.

  • >