Ascent/Descent position of selected character
how can find selected character lies in ascender line or descender line?
i so:
main(); function main() { var outlines, gb; if (app.selection.length > 0 && app.selection[0].constructor.name == "character") { outlines = app.selection[0].createoutlines(false)[0]; gb = outlines.geometricbounds; outlines.remove(); alert("ascender line = " + roundstring(gb[0], 1) + ", descender line = " + roundstring(gb[2], 1)); } 0 } function roundstring(numval, decimals) { var retval = math.round(numval * math.pow(10,decimals)) + ""; retval = retval.substring(0,retval.length-decimals) + "." + retval.substring(retval.length-decimals); return retval; }
More discussions in InDesign Scripting
adobe
Comments
Post a Comment