Adobe 65010248 Scripting Guide - Page 29
Measurement units, Em space units, item positioning and dimensions
UPC - 883919156484
View all Adobe 65010248 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 29 highlights
CHAPTER 3: Scripting Illustrator Measurement units 29 Measurement units Illustrator uses points as the unit of measurement for almost all distances. One inch equals 72 points. The exception is values for properties like kerning, tracking, and the aki properties (used for Japanese text composition), which use em units. (See "Em space units" on page 29.) Illustrator uses points when communicating with your scripts regardless of the current ruler units. If your script depends on adding, subtracting, multiplying, or dividing specific measurement values for units other than points, it must perform any unit conversions needed to represent your measurements as points. For example, to use inches for coordinates or measurement units, you must multiply all inch values by 72 when entering the values in your script. The following table shows conversion formulas 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) JavaScript provides the UnitValue object type, which offers unit-conversion utilities. For details, see JavaScript Tools Guide. Em space units Values that use em units instead of points are measured in thousandths of an em. An em is 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. In a 10-point font, a kerning value of 20 em units is equivalent to: (20 units x 10 points) / 1000 units/em = 0.2 points Page-item positioning and dimensions Illustrator uses simple, two-dimensional geometry in the form of points to record the position of page item objects in a document. Every page item object in a document has a position property that defines a fixed point as a pair of page coordinates in the format [x, y]. The fixed point is the top-left corner of the object's bounding box. For information on the types of objects that comprise the page items collection, see "The artwork tree" on page 19. A point is designated by a pair of coordinates: ➤ The horizontal position, x ➤ The vertical position, y