Copy link to clipboard
Copied
Hi?
How to find font name in ".eps" (Math Type) in Indesign using java script?
I used below code but only getting text font list
var myApplicationFonts = app.fonts;
var myDocument = app.documents.item(0);
var myStory = myDocument.stories.item(0);
var myDocumentFonts = myDocument.fonts;
var myDocumentFontNames = myDocument.fonts.everyItem().name;
var myString = "Document Fonts:\r";
for(var myCounter = 0;myCounter<myDocumentFontNames.length; myCounter++)
{
myString += myDocumentFontNames[myCounter] + "\r";
}
myStory.contents = myString;
Could you please help me anyone?
Thanks,
Arun
var usedFonts = app.documents[0].fonts;
var usedFonts = app.documents[0].fonts;
for (var i = 0; i < usedFonts.length; i++)
{
$.writeln (usedFonts.name)
}
Copy link to clipboard
Copied
var usedFonts = app.documents[0].fonts;
var usedFonts = app.documents[0].fonts;
for (var i = 0; i < usedFonts.length; i++)
{
$.writeln (usedFonts.name)
}
Copy link to clipboard
Copied
It is working, Thank you very much
Copy link to clipboard
Copied
Hi @priyak7746321 ,
It is included both the fonts document textual fonts and and eps fonts.
If required only eps fonts or only document textual fonts then what?
-Sumit
Copy link to clipboard
Copied
Hi Sumit,
provide a sample EPS file from MathType and we'll see…
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Uwe Laubender,
I have copied package file with links.
https://www.dropbox.com/s/2lhfrhtpdrqxe8g/font_test%20Folder.zip?dl=0
Requirements are both (inside graphic and textual) the font list should be seperate.
Regards,
Sumit
Copy link to clipboard
Copied
Hi Sumit,
just looked into your document.
Did a test with scripting the fonts that are visible with app.documents[0].fonts and came to the conclusion that this could only be solved by either scripting InDesign's preflight function or by inspecting the code of every placed EPS file.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Look into the EPS file's PostScript comments code:
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 69 218
%%Creator: MathType
%%Title: Eqn001.eps
%%CreationDate: 07/25/21
%%DocumentFonts: Humanist521BT-Roman
%%+ Symbol
%%DocumentNeededFonts: Humanist521BT-Roman
%%+ Symbol
%%DocumentProcessColors: Black
%%Baseline: 107
%%Dimensions: H=3.027, W=0.958
%%EndComments
There you have it:
%%DocumentNeededFonts: Humanist521BT-Roman
%%+ Symbol
Compare the names of that fonts with the fonts available through app.fonts and also app.documents[0].fonts in case there is a Document fonts folder in the same path with the document file.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Sumit,
and just another thing: You cannot substitute the needed fonts in InDesign. You have to install them or make them available with a Document fonts folder. That could fail at all if the MathType EPS file comes from a Mac and the InDesign document is opened on Windows 10. Why? Because the PostScript names of similar fonts do not match.
Symbol is not SymbolMT.
Eqn022.eps for example needs SymbolMT that is a standard font on Windows 10. No issue.
Eqn001.eps needs Symbol. That is a big issue.
Would it help to edit the placed EPS file? Perhaps yes.
Also doable with ExtendScript.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thank you @Laubender for your efforts.
Copy link to clipboard
Copied
Hi Sumit,
also note that all MathType users will run into big trouble in an upcoming version of InDesign when PostScript Type-1 fonts will be not supported anymore. Even if the makers of MathType software would allow the inclusion of Type-1 fonts with EPS files in a future version, legacy InDesign documents that use EPS files with no fonts included will not work anymore.
Either MathType will change and PDFs with included fonts can be used, instead of EPS files, or the product will be dead.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thank you @Laubender for the update and I am sure their (MathType) developer already working on this.