Peter Kahrel wrote:
> what would you do with it?
Well, as you know, I use a script to insert a letter with some accent. If a character doesn't exist in the current font, it combines (tries to, anyway) the letter and the floating accent. The check if a character exists in a font is an ugly workaround: enter the character, convert it to outlines. If that works, the character is in the font, so undo the conversion and you're done; if it didn't work, delete the outline and insert the letter and the floating accent, then kern the accent over the letter. Ugh.
Ah of course! I use that script about 100 times a day, so a belated thank you!
Unfortunately, grabbing the cmaps out of a file is way, way too slow to use in an interactive dialog. It takes about 5 seconds for a simple font of about 200 characters, and for something like Calibri or Arial (which each have several thousands of characters) it takes more than 10 seconds.
There are also lots of font types that I cannot support -- aforementioned Type 1 PostScript fonts, but also TrueType collections (TTC), which may have several font definitions in a single file (which makes it nigh on impossible to find the 'proper' one), and, on my Mac, .dfont and Ye Really Old system fonts such as Bourdeax Roman Bold, which store all of their information in the longly-deprecated Resource Fork, which is inaccessible through Javascript.
On the plus side, I really enjoy seeing character listings such as this one, in Calibri: