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

Find Missing Glyphs/Fpmts

New Here ,
Aug 26, 2024 Aug 26, 2024

Hi Guys,

I need yours help.

I have one document in illustrator, It have missing glyph/font. Attached Screenshot below. Particular missing charchter not available in particular font family. So it's automatically changed to "Placedholder/rectangle" shape. need to find the missing glyphs with particular "placeholder/rectangle"shape. I have tried more. Unable to find the missing charchter shape.


Ayubda_0-1724738941909.png
I have tried below code:

// Function to find placeholder symbols for missing characters
function findMissingCharacterPlaceholders(missingChar) {
var doc = app.activeDocument;
var placeholders = [];
 
// Loop through all text frames in the document
for (var i = 0; i < doc.textFrames.length; i++) {
var textFrame = doc.textFrames[i];
var textRange = textFrame.textRange;
 
// Check each character in the text frame
for (var j = 0; j < textRange.characters.length; j++) {
var character = textRange.characters[j];
 
// Check if the character has a missing glyph and is replaced by a placeholder symbol
if (character.contents === missingChar && isPlaceholder(character)) {
// Get the placeholder related to the missing character
var placeholder = findPlaceholderForCharacter(textFrame, j);
if (placeholder) {
placeholders.push({
textFrame: textFrame,
characterIndex: j,
placeholder: placeholder
});
}
}
}
}

return placeholders;
}

// Function to check if the character is replaced by a placeholder symbol
function isPlaceholder(character) {
// Placeholder check: Adjust this condition if necessary
// e.g., check for a specific font or other attributes if needed
return character.textFont.name === "PlaceholderFont"; // Replace "PlaceholderFont" with actual placeholder font name if known
}

// Function to find the placeholder shape for a given character index in a text frame
function findPlaceholderForCharacter(textFrame, charIndex) {
var charBounds = textFrame.textRange.characters[charIndex].geometricBounds;
var placeholder = null;
 
// Check each page item in the document
for (var i = 0; i < app.activeDocument.pageItems.length; i++) {
var item = app.activeDocument.pageItems[i];
 
// Check if the item is a shape or symbol that could represent the placeholder
if (item.typename === "PathItem" || item.typename === "CompoundPathItem") {
var itemBounds = item.geometricBounds;
if (itemBounds[0] >= charBounds[0] && itemBounds[1] >= charBounds[1] &&
itemBounds[2] <= charBounds[2] && itemBounds[3] <= charBounds[3]) {
placeholder = item;
break;
}
}
}

return placeholder;
}

// Define the missing character to search for
var missingChar = "e"; // Character that is missing
var placeholders = findMissingCharacterPlaceholders(missingChar);

// Output results
if (placeholders.length > 0) {
alert("Missing character '" + missingChar + "' placeholders found.");
} else {
alert("No missing character placeholders found.");
}

 

TOPICS
Bug , How-to , Print and publish , Scripting , Tools , Type
683
Translate
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

Community Expert , Aug 27, 2024 Aug 27, 2024

Did the document come from another computer? If so, it's possible the other computer has a slightly different and perhaps newer version of the font used to style the text.

 

Does the place-holder box remain if you change the text object's font? I'm guessing a É glyph was used in the word "LEGUME." It seems unusual for a glyph like that to be missing in a font file.

Translate
Adobe
Community Expert ,
Aug 27, 2024 Aug 27, 2024

Did the document come from another computer? If so, it's possible the other computer has a slightly different and perhaps newer version of the font used to style the text.

 

Does the place-holder box remain if you change the text object's font? I'm guessing a É glyph was used in the word "LEGUME." It seems unusual for a glyph like that to be missing in a font file.

Translate
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 ,
Aug 28, 2024 Aug 28, 2024
LATEST

Thanks Boby Henderson, Got It.

Translate
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