Adobe 26001360 Scripting Guide - Page 43
Unit conversion to points, Em Space Units, Conversion formula
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 43 highlights
Adobe Illustrator CS Scripting Guide 43 If TypeName(selectedObjects) = "Variant()" Then For Each objectRef In selectedObjects There are 72 points per inch, so the following will move the 'object 2" to the right and 6" up objectRef.Translate 144, 226 Next End If End Sub If your script depends on adding, subtracting, multiplying, or dividing specific measurement values for units other than points, the script will need to convert between the units numerically. For example, to use English measurements such as inch values for coordinates or measurement units, your script will need to multiply all inch values by 72 to convert to points, since there are 72 points in an inch. To use metric measurements such as centimeters, you will need to multiply all centimeter values by 28.346, since there are 28.346 points in a centimeter. Unit conversion to points This table displays the conversion formulae for various units of measurement: Unit centimeters inches millimeters picas Qs Conversion formula 28.346 points = 1 centimeter 72 points = 1 inch 2.834645 points = 1 millimeter 12 points = 1 pica 0.709 point = 1 Q (1 Q equals 0.23 millimeter) Em Space Units One exception to the the rule of points being used for all measurements is the use of em units (a traditional typesetting measure) for a few properties such as for kerning and tracking. Values for these properties are measured in thousandths of an em space. Em units are proportional to the current font size. For example, in a 6-point font, 1 em equals 6 points; in a 10-point font, 1 em equals 10 points. Similarly, a kerning value of 20 em units for a 10-point font would be equivalent to: (20 units x 10 points) / 1000 units/em = 0.2 points 12 Aug 03