Copy link to clipboard
Copied
If we import or enter a text code (e.g. a Katakana character ) for which a font has no Glyph, then Indesign will display an x'd rectangle.
Is it possible to find/scan for these with a script?
Thanks !
I did finally manage to script a list of all the unassinged glyphs in my document - with .findGlyph().
This sample just writes to the extendscript toolkit js console.
[CS6]
-------------------------------------------------------------------------------
var myDocument=app.activeDocument;
var allFound = [];
var numFonts = myDocument.fonts.length;
for (var z=0;z<numFonts;z++) {
allFound = [];
app.findGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences = NothingEnum.nothing;
app.f
...Copy link to clipboard
Copied
Peter.
Thanks - works well !
pjb
e.g.,
4 Unassigned Glyphs in Myriad Pro | Regular |
十 21313 U+5341
分 20998 U+5206
な 12394 U+306a
利 21033 U+5229
--done--
Copy link to clipboard
Copied
There's a bug that prevents the script from working with font styles other than Regular (and probably Roman). The problem is that doc.fonts
app.findGlyphPreferences.appliedFont = doc.fonts
with these two:
app.findGlyphPreferences.appliedFont = doc.fonts
app.findGlyphPreferences.fontStyle = doc.fonts
Peter
Copy link to clipboard
Copied
I'd only tried "regular" font styles, and didn't have occasion to notice the regular/roman bug, so I really appreciate Peter K.'s going back and ferreting this out. For those who know even less about scripting than I do, I got his fix to work in the code presented earlier in this thread by adjusting the three "doc." references in his before and after lines to "myDocument."
David
Copy link to clipboard
Copied
Peter
Thanks !
Pete
Copy link to clipboard
Copied
Pete,
This is the only way I can contact you. Hope you don't mind that I tarted up the script based on your excellent method with an interface and posted it on my site at http://www.kahrel.plus.com/indesign/missing_glyphs.jsx
Peter
Copy link to clipboard
Copied
This is the best, juiciest addition to my InDesign workflow ever. Thanks so much Peter 🙂
I work with a lot of text books with Japanese and Chinese content. Our editors will often type script into a line of text (using InCopy) without the correct script font selected and I end up with 400pp+ docs riddled with these annoying, tiny pink boxes. Your script fixed this in minutes. Brilliant.
Copy link to clipboard
Copied
That's great
Glad to help.
I merged that script into our CopyFlow Gold extension at napsys.com
All the best,
Pjb
Sent from my iPhone
Copy link to clipboard
Copied
Hello,
there is a problem when I run that missing_glyphs.jsx script in Indesign CC 2018 / Mac OS 10.13.6: it will not find any missing glyphs on master pages. I tried to modify that script by including app.findChangeGrepOptions.includeMasterPages = true; like this:
app.findGlyphPreferences = null;
app.findGlyphPreferences.glyphID = 0;
app.findGlyphPreferences.appliedFont = docFonts.fontFamily;
app.findGlyphPreferences.fontStyle = docFonts.fontStyleName;
app.findChangeGrepOptions.includeMasterPages = true; // <- new line added
found = app.activeDocument.findGlyph();
but still it will not find missing glyphs on master pages. Is there another solution for this?
Greetings
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
oIndesign.FindGlyphPreferences = 1851876449
oIndesign.FindGlyphPreferences.glyphID = 0
oIndesign.FindGlyphPreferences.AppliedFont = oDocument.TextFrames(1).Characters(13).appliedfont.name // 小塚明朝 Pro
Dim oFind As Object = oDocument.FindGlyph()
If set oIndesign.FindGlyphPreferences.glyphID = 0 :FindGlyph() not return value
If set oIndesign.FindGlyphPreferences.glyphID = CID of oDocument.TextFrames(1).Characters(13) :FindGlyph() return value
Font name is Japanese
Font name is English ,It is ok.
Copy link to clipboard
Copied
I modified your sceript to make it work in CC2019
var myDocument=app.activeDocument;
$.writeln('--Looking for missing fonts in ' + myDocument.name + '--');
var allFound = [];
var numFonts = myDocument.fonts.length;
for (var z=0;z<numFonts;z++) {
allFound = [];
app.findGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences.glyphID = 0;
app.findGlyphPreferences.appliedFont = myDocument.fonts[z].name;
allFound = app.findGlyph ();
if (allFound.length>0) {
$.writeln(allFound.length+ ' Unassigned Glyphs in ' + myDocument.fonts[z].name );
for (var y=0;y<allFound.length;y++) {
$.writeln(allFound[y].contents+ ' ( ' +allFound[y].contents.charCodeAt(0)+')' );
}
}
}
$.writeln('--done--');