Module: Prawn::Measurements

Included in:
Numeric
Defined in:
lib/prawn/measurements.rb

Stable API (collapse)

Instance Method Details

- (Object) cm2mm(cm)

metric conversions



11
12
13
# File 'lib/prawn/measurements.rb', line 11

def cm2mm(cm)
  return cm * 10
end

- (Object) cm2pt(cm)



54
55
56
# File 'lib/prawn/measurements.rb', line 54

def cm2pt(cm)
  return mm2pt(cm2mm(cm))
end

- (Object) dm2mm(dm)



15
16
17
# File 'lib/prawn/measurements.rb', line 15

def dm2mm(dm)
  return dm * 100
end

- (Object) dm2pt(dm)



58
59
60
# File 'lib/prawn/measurements.rb', line 58

def dm2pt(dm)
  return mm2pt(dm2mm(dm))
end

- (Object) ft2in(ft)

imperial conversions from en.wikipedia.org/wiki/Imperial_units



25
26
27
# File 'lib/prawn/measurements.rb', line 25

def ft2in(ft)
  return ft * 12
end

- (Object) ft2pt(ft)



42
43
44
# File 'lib/prawn/measurements.rb', line 42

def ft2pt(ft)
  return in2pt(ft2in(ft))
end

- (Object) in2pt(inch)



38
39
40
# File 'lib/prawn/measurements.rb', line 38

def in2pt(inch)
  return inch * 72
end

- (Object) m2mm(m)



19
20
21
# File 'lib/prawn/measurements.rb', line 19

def m2mm(m)
  return m * 1000
end

- (Object) m2pt(m)



62
63
64
# File 'lib/prawn/measurements.rb', line 62

def m2pt(m)
  return mm2pt(m2mm(m))
end

- (Object) mm2pt(mm)



50
51
52
# File 'lib/prawn/measurements.rb', line 50

def mm2pt(mm)
  return mm * (72 / 25.4)
end

- (Object) pt2mm(pt)



66
67
68
# File 'lib/prawn/measurements.rb', line 66

def pt2mm(pt)
  return pt * 1 / mm2pt(1) # (25.4 / 72)
end

- (Object) pt2pt(pt)

PostscriptPoint-converisons



34
35
36
# File 'lib/prawn/measurements.rb', line 34

def pt2pt(pt)
  return pt
end

- (Object) yd2in(yd)



29
30
31
# File 'lib/prawn/measurements.rb', line 29

def yd2in(yd)
  return yd * 36
end

- (Object) yd2pt(yd)



46
47
48
# File 'lib/prawn/measurements.rb', line 46

def yd2pt(yd)
  return in2pt(yd2in(yd))
end