Skip to content

Instantly share code, notes, and snippets.

@UskeS
Last active January 6, 2019 14:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UskeS/353b433d969beff3c9343a1e744ed1c2 to your computer and use it in GitHub Desktop.
Save UskeS/353b433d969beff3c9343a1e744ed1c2 to your computer and use it in GitHub Desktop.
[InDesign][extendScript] 合成フォントの設定を書き出し
!function() {
var doc = app.activeDocument;
var compFonts = doc.compositeFonts;
var result = [];
for (var k=1; k<compFonts.length; k++) {
result.push("# " + compFonts[k].name);
var cfEnt = compFonts[k].compositeFontEntries;
for (var i=0; i<cfEnt.length; i++) {
result.push("## " + cfEnt[i].name);
result.push("* フォント:"+cfEnt[i].appliedFont+"/"+cfEnt[i].fontStyle);
result.push("* サイズ:"+cfEnt[i].relativeSize);
result.push("* 水平比率:"+cfEnt[i].horizontalScale);
result.push("* 垂直比率:"+cfEnt[i].verticalScale);
result.push("* BLシフト:"+cfEnt[i].baselineShift);
result.push("* スケールオプション:"+((cfEnt[i].scaleOption)?"オン":"オフ"));
}
result.push("\r");
}
makeTxtFile(result.join("\n"), "~/desktop/"+doc.name.replace(/\.indd$/, ".md"));
function makeTxtFile(contents, path) {
var F = File(path), res;
try {
F.open("w");
F.encoding = "UTF-8";
res = F.write(contents);
} catch(e) {
alert(e);
} finally {
F.close();
}
}
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment