Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

Insert a Character by Unicode or GID

As you know, you can insert any character from a font by double-clicking it in the Glyphs panel. But that panel can get very tiresome if you have to use it often. For example, what if you often need to type the Rupee symbol? Or the right arrow symbol?

The good news is that there are several clever ways to type a character without having to find it inside the Glyphs panel and double-click it.

Recent Glyphs

If you insert a character once with the Glyphs panel, it will then show up in the Recent Glyphs section of the panel—which makes it much easier to find and insert again.

recently used glyphs

But even easier would be a way to “type” the character with your hands on the keyboard—even if the Glyphs panel is closed. You can do that by assigning a shortcut (using Edit > Keyboard Shortcut) to the Glyph: Insert Most Recent Glyph feature. It’s inside the Product Area called Panel Menus:

insert recent shortcut

Note that in the image above, I’ve set the Context popup menu to Text; that means this shortcut will only do anything when my text cursor is inside a text frame.

Of course, the biggest problem with this shortcut is that if I insert a character in the Glyphs panel, then that will become the most-recently used glyph. (In other words, the shortcut will start applying the newer glyph.) So here are some more options that ensure your shortcut will always provide you with the character you want.

Unicode Hex Input

I started writing a long section about how, if you know the Unicode number for the character you want, you can just type it—for example, Alt-03C0 on the numeric keypad would type a pi symbol. But it works slightly differently in different versions of Windows, and sometimes requires you to make a change to the Registry (eek!)… and on the Mac it requires that you set up and choose a different Input Method in System Preferences… and the whole thing is so clunky and hard to explain that I have now decided to skip it. OK, moving along…

Glyph Scripts

The coolest way to add precisely the character you want is to get a script to do it for you. There are a handful of scripts you can use, and they’re all easy. Before I tell you about the scripts, there are three things you need to know:

  • You do not need to open, edit, or alter the scripts in any way to customize them. In most cases, you simply need to duplicate and rename the script files on disk (just like renaming any other file).
  • If you need help installing scripts, see this article.
  • Once you have a script that inserts the character you want, you can assign a keyboard shortcut to it! I’ll tell you how below.

OK, here are the four helpful scripts:

  • Unicode Injector. You can add one or more Unicode characters at the same time with Rorohiko’s free Unicode Injector script. The script reads its own name, looks for unicode numbers, and then “types” those characters into the current text frame. For example, if you name the script (on disk) “insert U+20AC.jsx” and then run the script (with the text cursor flashing in a frame), it will insert the Euro symbol. The script ignores any text that isn’t a unicode number in the file name. By adding more than one unicode number, you can get a string of characters:

inserting unicode with a script

  • Unicode character script. Here’s another type-a-unicode script. It works pretty much the same as the Injector, but it only works with a single character. For example, if you name it “Multiplication_00D7.jsx” (or even just 00D7.jsx) then it will insert the multiplication symbol when you run the script. This version is much less robust (less error checking, etc.) but I wanted to include it just in case the one above isn’t available or doesn’t work for some reason. You can download it here.
  • GID script. Sometimes a glyph can only be inserted by its GID value in a specific font. For example, in the Minion Pro font, there are 26 different bullet characters, each “called” Unicode 2022. So the Unicode scripts won’t help. Olav Kvern wrote a very clever script he calls “Insert-A-Glyph’o-matic” that works much like the last two, but uses the script’s name to specify a GID value. For example, if the script is called “1254_floralheart_minionpro.jsx” (or even just 1254.jsx) then the script will insert GID value 1254 (which basically means the 1,254th character in the font). If the current position of the text cursor is set to Minion Pro, then you’ll get the character you want. If it’s any other font, you’ll almost certainly get some unexpected glyph. You can download the script here.

insert by gid code

  • Compose. Peter Kahrel wrote a script called Compose, which Anne-Marie wrote about here, and I recorded a movie at Lynda.com about here. Note that at the time of this writing, the script still has “cs3” in its name, but it appears to work just fine in CC 2017. You don’t need to rename this script or anything like that; when you run it, it asks what character you want to insert. So on the one hand, it’s extremely flexible and powerful; but on the other hand, it’s not as good if you find yourself needing to insert the same character many times a day.

Giving it a Shortcut

Searching for the right script to run in the Scripts panel is hardly any more efficient than searching for the right character in the Glyphs panel. So why go through all the work to use a script? Because you can apply a keyboard shortcut to a script! (Or run it using the Quick Apply panel.)

To apply a shortcut, choose Edit > Keyboard Shortcuts and choose (or make) your custom Script set. Choose Scripts from the Product Area, and then scroll through the list of scripts until you find the one you want. Select it, click in the New Shortcut field, and type the shortcut you want to assign. I suggest setting the Context menu to Text, so that the shortcut is only triggered when the text cursor is active in a story. And finally click Assign.

assign shortcut to script

Now, whenever you press that shortcut, the proper glyph will be inserted, depending on whether you used a Unicode or GID script.

David Blatner

David Blatner

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

Latest posts by David Blatner (see all)

  • - November 30, -0001
Related Articles
Comments

13 Comments on “Insert a Character by Unicode or GID

  1. Very interesting, but how is this quicker than opening the glyph panel and finding the glyph? I get that you might want to put in a floral heart into your text 50 times, but surely you would simply do a search and replace for the character that had been put in or you would assign a bullet style to the paragraph.

    • Raphael, you’re saying that pressing a keyboard shortcut is not faster than opening the Glyphs panel, scrolling down until you find the glyph you’re looking for, then double-clicking it, then closing the panel?

      No, if you need particular glyphs (multiplication symbol, or a particular currency symbol, or some character which is not easily typed) then these are far, far faster!

      I’m not talking about bullets… I’m talking about characters you need to type in the middle of a paragraph.

  2. Okay, so I hear you regarding characters like the multiplication symbol. But as a great believer in keyboard shortcuts, to create a script for a × and then use up a valuable keyboard shortcut seems to be a waste. Personally, I use PhaseExpress Freeware and when I need a multiplication symbol like in this post, I simply type three xs in a row. I deal with multilingual typesetting and deal not only with English, Hebrew (with trop) but also other languages such as Russian and Greek.

    What would be way more useful would be a script that you could type the unicode value in. This would be more generic. So rather than remembering ALT-0150 is an en-dash (and I still do it that way), you could have a script which you could assign say ALT-0 to and there would be a pop-up and you could put in your unicode value in and then it could input the ornament.

    Yes it would still be a problem for Minion, but then that’s where IndyFont comes in (by the way, that you for that recommendation – I bought the software from the link on your site). Now if you could adjust the script to use your custom font name then you could easily type in any character with using only one shortcut key.

  3. Great article, I’ll give those scripts a shot. Inserting the multiplication sign gives me headaches :D

    I personally use Apple’s character map when outside of InDesign, since I never remember the hexes correctly. There you can type the Unicode name for the character you’re searching for, which helps (i.e. ‘Multiplication sign’ instead of ‘U+00D7’)

    I’m currently writing a bit on the Unicode / GID subject for my own students, but I cannot find anywhere what the letters “GID” stand for, can you help me by any chance?

  4. When I have to create a “foreign” business card for companies travelling over seas e.g mandarin chinese, sometimes the client only supplies me a jpg image and no live text. I use google translate app on my phone to read the text and copy the result, send the text to my computer and copy and paste it into indesign. Making sure i have a Mandarin font selected I wont have to search through thousands of similar glyphs in the glyphs panel as the correct glyph will automatically be used.

  5. Multiplication symbol…

    On PC, if you have Czech keyboard set, its simple, press ALTgr+)
    And for MAC users i have a TIP. I am sure you know Autocorrect in Indesign.
    Go to the preferences CTRL/CMD+K Autocorrect – be carefull which Language you have selected and just set incorect word for example “qx” and corect word set to “×”
    Now if you want to write multiplication symbol “×” just write qx{space} and whoalaa.. multiplication symbol will show up.

Leave a Reply

Your email address will not be published. Required fields are marked *