Converter tables
From Vectorlab
Common conversion tables for various units. To be expanded.
[edit] Conversions
| 1 inch (in) | 25.4 mm | |
|---|---|---|
| 1 foot (ft) | 12 in | 30.48 cm |
| 1 yard (yd) | 3 ft | 91.44 cm |
| 1 mil | 0,001 in | 0,0254 mm |
| 1 ft | 0,3048 m | 304,8 mm |
| 1 mm | 0.039370 in | 1/25,4 in |
| Points | ||
| 1 point | 1/72 in | 1/1828,8 mm |
| 1 point | 1/(25.4*72) mm | 0,000547 mm |
| 1 in | 72 points | |
| 12 points | 1 pica | |
| 6 pica | 1 in | |
[edit] UPI (Units Per Inches)
A user can set the document units to any value, including custom ones, thus an environment check might be necessary for correct retrival of dimensions and further usage within VectorScript.
| current unit to inches | x := x / upi |
|---|---|
| current unit to mm | x := x / upi * 25,4 |
| mm to current unit | x := x * upi / 25,4 |
Available routines for checking the current units settings are:
- GetUnits returns many unit's settings, including UPI
- GetPrefReal(152) returns UPI.
- Examples
if document units are inches GetPrefReal(152) = 1 if document units are feets GetPrefReal(152) = 0.08333333333... if document units are yards GetPrefReal(152) = 0.02777777777... if document units are miles GetPrefReal(152) = 1.578282828283e-05... if document units are metres GetPrefReal(152) = 0.0254 if document units are centimeters GetPrefReal(152) = 2.54 if document units are millimeters GetPrefReal(152) = 25.4
[edit] Routines that require/return specific units values
Some VectorScript routines need or return values in a defined unit and a conversion from the current unit settings to inches or millimeters might be needed:
[edit] returning mm
- GetObjectVariableReal
( h: HANDLE; index: INTEGER): REAL;
[edit] requesting mm
- OffsetPoly
(hPoly: HANDLE; dist: REAL): HANDLE;
[edit] returning in
[edit] page in
- GetMarker
( h:HANDLE; VAR start:BOOLEAN; VAR END:BOOLEAN; VAR style:INTEGER; VAR size:REAL );Size is always page inches. - FMarker
( VAR style:INTEGER; VAR size:REAL; VAR ang:INTEGER );Size is always page inches.
[edit] real world in
- GetTexBitFeatureSize
( textureBitmap: HANDLE ):REAL; - GetTexSpace2DOffset
( textureSpace: HANDLE; VAR offsetU: REAL; VAR offsetV: REAL ); - GetTexBitFeatureSize
( textureBitmap: HANDLE ):REAL; - GetTextureSize
( texture: HANDLE ):REAL;
[edit] requesting in
[edit] page in
[edit] real world in
- SetTexBitFeatureSize
( textureBitmap: HANDLE; featureSize: REAL); - SetTexSpace2DOffset
( textureSpace: HANDLE; offsetU: REAL; offsetV: REAL); - SetTextureSize
( texture: HANDLE; newSize: REAL);
[edit] See also
- DPI dots per inches
- Image resolution
- Printing type
- Typographic unit
