-
Notifications
You must be signed in to change notification settings - Fork 5
/
distance.go
30 lines (27 loc) · 1.11 KB
/
distance.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package measurement
// Distance represents a distance and is automatically converted
// to the units needed internally in the various ECMA 376 formats.
type Distance float64
// Constants for various distance units
const (
Zero Distance = 0
Point = 1
Pixel72 = 1.0 / 72.0 * Inch
Pixel96 = 1.0 / 96.0 * Inch
HalfPoint = 1.0 / 2.0 * Point
Character = 7 * Point
Millimeter = 2.83465 * Point
Centimeter = 10 * Millimeter
Inch = 72 * Point
Foot = 12 * Inch
Twips = 1.0 / 20.0 * Point
EMU = 1.0 / 914400.0 * Inch
HundredthPoint = 1 / 100.0
Dxa = Twips
)