Skip to main content
James Gifford—NitroPress
Legend
February 20, 2025
Question

Export Unicode glyph?

  • February 20, 2025
  • 3 replies
  • 1318 views

I have the feeling I've asked this before but I can't bring any answer to mind.

 

Is there any way to export a Unicode glyph-code directly to exported output (EPUB or HTML) without it being modified into text? I seem to recall some code, setting, override... something.

 

For example, if I put ࢐ in text and export it to EPUB, I get... "blah blah ࢐ blah blah" in the XHTML output. If I edit '&' to just '&' — boom, I get the left-arrow I wanted.

 

So is there any way to mark or flag that code for export without the modification? I feel as if I'm missing something, and that something may be "no, you can't do that." 🙂

 

I've discovered that if you cut and paste the actual glyph (from a symbols web page, for example) it may show a Dreaded Pink Box in InDesign, but seems to export exactly as desired. Looking for a better method, though.

 

 

ETA: I've also discovered there's a very peculiar little script in the Community folder (InjectUnicode.jsx) that can be configured to "inject" one or more Unicode characters at the cursor, but it has to be configured by renaming the script for each character or set of characters. Anyone have a more general implementation that, say, pops up a list of glyphs (configurable would be nice) or at least a code entry field, instead of being 2012-hardwired to one string?

3 replies

Marc Autret
Legend
February 24, 2025
quote

(…) Anyone have a more general implementation that, say, pops up a list of glyphs (configurable would be nice) or at least a code entry field, instead of being 2012-hardwired to one string?

 

The InstantUnicode ‘responsive’ script may help — just type your codepoint in the form uHHHH and it instantly inserts the glyph at the insertion point:

https://indiscripts.com/post/2020/03/instantunicode-insert-characters-by-typing-their-codepoint

 

(Also supports code points beyond the BMP using the uppercase form U1HHHH.)

 

Hope that helps.

Best,

Marc

James Gifford—NitroPress
Legend
February 24, 2025

That's an excellent solution along the lines I was thinking — just making it all a little easier for those who use Unicode a lot. For simple projects, though, once you've looked up the Unicode value, just cutting and pasting the actual glyph is an option as well.

 

Thx!

James Gifford—NitroPress
Legend
February 21, 2025

By Jove, I think that's it.

  • Install Symbola or the mega-symbol font of your choice; you could use more conventional sets like Dingbats, Webdings or Symbol but it might be better (and have further reach) to use a specific "symbols" font.
  • Create a Character Style named SYMBOLEXPORT or something, with characteristics as close to [None] as possible, especially a null font assignment.
  • Dupe that style and name it SYMBOLA or FANCYDANCYGLYPHS or something. Make a simple change to Symbola font and leave all else null/default.
  • While styling and formatting and building, use the latter style to highlight symbols entered using the Glyph panel (hint: Unicode has to be entered in hex, using your favorite glyph lookup tool if needed). These will now print and PDF-export in visible glyph form.
  • For export to HTML or EPUB, do a simple F/R to replace SYMBOLA with SYMBOLEXPORT. All or most of your fancy glyphs will turn to pink boxes but will export to EPUB perfectly. DO NOT export fonts. No CSS needed (for this element anyway).
  • As needed, use the reverse F/R (or just dump the converted but previously saved source file) to restore the visible glyphs.

 

(Technically, there's no need to do the switch to Little Pink Boxes, as exporting without embedding Symbola would have much the same result. But I find it cleaner and more transparent to remove that font completely from the export so that the glyphs are handled by the reader without looking for a font, or the wrong font, or otherwise getting too complicated at the reader/user end. You could also include a CSS statement to null out the Symbola assignment, without having to modify the export doc... something is making me think the actual doc fix has advantages but I can't put a finger on why. Much more extensive testing to come.)

 

Can't think of a more straightforward process, to manage this on a running basis, without extra tools, manual conversion, embedded fonts, etc.

 

Thanks for the insight here, Joel!

Robert at ID-Tasker
Legend
February 21, 2025

"&#2192" is just bunch of characters - it will never be treated the way you want - you would've to change it to a desired glyph - displayed as such in InDesign - before export. 

 

FindChangeList.txt should work - but you'll have to create a list of all instances. 

 

Or a simple script can run a search - text or GREP - and insert those glyphs. 

 

 

Or probably autocorrect would work... 

 

James Gifford—NitroPress
Legend
February 21, 2025

Right, in a DM exchange with an author, we ran it down to cut-and-pasting the actual Unicode glyph in place, which results in a pink box some good part of the time. This will export perfectly (or at least has so far).

 

I was thinking, perhaps of some other app or process, that there was a way to "inject" raw code into export — can't something like that be done with Publish Online, for SVGs and blocks of HTML code? — but this bit of wonky magic doesn't exist for ID to EPUB. Just a matter of using font-based glyphs for print, PDF etc. and switching to direct Unicode glyphs for export. Not impossilble, just... demanding.

Robert at ID-Tasker
Legend
February 21, 2025
quote

[...] Not impossilble, just... demanding.


By @James Gifford—NitroPress

 

Nothing is demanding anymore 😉