2 Replies Latest reply on Jan 16, 2009 4:38 AM by subhaoviya

    how to find the glyphs character using js in indesign cs2?

    subhaoviya Level 1
      i want to find whether the glyphs character(registered trademark symbol)is applied with character style superscript or not, i cant able to fix the glyphs character in the find preference, how to do it?

      thanks

      subha
        • 1. Re: how to find the glyphs character using js in indesign cs2?
          [Jongware] Most Valuable Participant
          You are mixing two concepts. There is a
          i major
          difference between a
          b glyph
          and a
          b character.

          A glyph is any singular graphic in a font.
          A character is an instance of a character set (in InDesign, and in Mac OS X, it's the Unicode set; older programs use 'code pages' to translate codes into characters). [*]

          Why are they different? Well, a ligature ('ffi', for example) is not a single character, containing the characters 'f', 'f', and 'i'. It
          i is
          a single glyph in most fonts, but (usually!) you cannot insert an 'ffi' directly. Programs that do allow insertion of glyphs (again, such as InDesign) are also smart enough to decompose it into single characters 'f', 'f', and 'i' again.

          Why is this distinction important? In CS2, you can search for
          i characters
          but not for
          i glyphs
          (in CS3 and higher you can, but you cannot specify "+superscript").

          All aside, you can insert a trademark character directly into InDesign by calling up the Glyphs :-) panel and double-click the glyph. (It works because the 'TM' is also a valid Unicode character.) Then just cut it, and paste into the 'Find' field of the Find Text box. Alternatively, since you can see the Unicode value in the Glyphs panel, you can enter the Unicode directly into the search field, surrounded by less-greater than: < 2122 > (without the spaces). This works for all Unicode characters.

          Even better is that the character is also in the Find drop down menu -- "Registered Trademark Symbol". This inserts the shortcut "^r" in the Find box -- but it only works for a selected set of characters.

          Since this is the Scripting forum, I'm guessing you want to use this in a script. Well, both "< 2212 >", and "^r" can be used in the search string to specify the character. Do the search and examine for each found item if it has a position Superscript or not.

          [*] Post-edit: to expand a bit more, a table in the font associates Unicodes (character values) with glyphs, not the other way around. Every Unicode character available in the font associates to at least one single glyph. There may be more Unicodes than glyphs in a font (there is no law against associating more than one Unicode to a glyph -- for instance, both 'space' and 'non-breaking space' point to a single space glyph), and there may also be more glyphs than Unicodes (the 'ffi' glyph has a Unicode value -- now considered an early error in the Unicode definition! -- but the 'Th' glyph does not). Most programs only allow Unicode characters in text.
          • 2. Re: how to find the glyphs character using js in indesign cs2?
            subhaoviya Level 1
            thanks a lot jongware
            its working