• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Finding Unassigned Glyphs

Participant ,
Jul 17, 2012 Jul 17, 2012

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 !

TOPICS
Scripting

Views

29.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jul 18, 2012 Jul 18, 2012

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

...

Votes

Translate

Translate
Participant ,
Jul 20, 2012 Jul 20, 2012

Copy link to clipboard

Copied

Peter.

Thanks - works well !

pjb

e.g.,

4 Unassigned Glyphs in Myriad ProRegular

十   21313  U+5341

分   20998  U+5206

な   12394  U+306a

利   21033  U+5229

--done--

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2012 Aug 01, 2012

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.name returns e.g. Times ItalicItalic and Helvetica BoldBold. The workaround is to change this line:

app.findGlyphPreferences.appliedFont = doc.fonts.name;

with these two:

app.findGlyphPreferences.appliedFont = doc.fonts.fontFamily;

app.findGlyphPreferences.fontStyle = doc.fonts.fontStyleName;

Peter

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 01, 2012 Aug 01, 2012

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

Peter

Thanks !

Pete

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2012 Aug 08, 2012

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 17, 2017 Feb 17, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 17, 2017 Feb 17, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 05, 2019 Apr 05, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

Hi crazyPanda ,

do your includeMasterPages on findChangeGlyphOptions.

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 05, 2019 Apr 05, 2019

Copy link to clipboard

Copied

Hello Laubender

it works now.

Thank you very much.

Greetings

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 07, 2015 Aug 07, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

LATEST

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--');

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines