Skip to main content
Known Participant
December 31, 2013
Question

How to get glyph ID using JS?

  • December 31, 2013
  • 2 replies
  • 2725 views

Hello,

Please let me have the details to get the glyph ID using JS like some of the special characters used in the InDesign file doen't have the unicode value and InDesign is replacing them as � while exporting as HTML file. So to differentiate these symbols, we'd like to replace those characters with glyph ID which are having different IDs like 1602, 1604, etc.

Thanks,

Praveen

This topic has been closed for replies.

2 replies

Jongware
Community Expert
Community Expert
January 3, 2014

You are misunderstanding the purpose of a "glyph id". It is the numerical index of a particular glyph in a particular font. It has nothing to do with ID's special characters.

For example, the character 'a' (U+0061) has a Glyph ID of 68 in "Times New Roman", 66 in Minion Pro, and 73 in Baskerville. This tells you nothing you could possibly use for an export to HTML -- if only because the glyph ids may also vary per font version. One of the tables in each font file links Unicode values to their appropriate glyph ids.

What 'characters' do return 'U+FFFD' as their Unicode? In a quick test, I found one: "Page Break" -- but that is because "Page Break" is not in the Unicode tables. (It's also useless to try to convert its function into HTML.)

GejarajaAuthor
Known Participant
January 2, 2014

Anyone please respond to this requirement?

Peter Kahrel
Community Expert
Community Expert
January 2, 2014

You can find the decimal and hexadecimal values of a glyph. I don't think you can get the glyph's ID though.

Peter