module Prawn::Measurements

@group Stable API

Public Instance Methods

cm2mm(cm) click to toggle source

metric conversions

# File lib/prawn/measurements.rb, line 10
def cm2mm(cm)
  cm * 10
end
cm2pt(cm) click to toggle source
# File lib/prawn/measurements.rb, line 53
def cm2pt(cm)
  mm2pt(cm2mm(cm))
end
dm2mm(dm) click to toggle source
# File lib/prawn/measurements.rb, line 14
def dm2mm(dm)
  dm * 100
end
dm2pt(dm) click to toggle source
# File lib/prawn/measurements.rb, line 57
def dm2pt(dm)
  mm2pt(dm2mm(dm))
end
ft2in(ft) click to toggle source

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

# File lib/prawn/measurements.rb, line 24
def ft2in(ft)
  ft * 12
end
ft2pt(ft) click to toggle source
# File lib/prawn/measurements.rb, line 41
def ft2pt(ft)
  in2pt(ft2in(ft))
end
in2pt(inch) click to toggle source
# File lib/prawn/measurements.rb, line 37
def in2pt(inch)
  inch * 72
end
m2mm(m) click to toggle source
# File lib/prawn/measurements.rb, line 18
def m2mm(m)
  m * 1000
end
m2pt(m) click to toggle source
# File lib/prawn/measurements.rb, line 61
def m2pt(m)
  mm2pt(m2mm(m))
end
mm2pt(mm) click to toggle source
# File lib/prawn/measurements.rb, line 49
def mm2pt(mm)
  mm * (72 / 25.4)
end
pt2mm(pt) click to toggle source
# File lib/prawn/measurements.rb, line 65
def pt2mm(pt)
  pt * 1 / mm2pt(1) # (25.4 / 72)
end
pt2pt(pt) click to toggle source

PostscriptPoint-converisons

# File lib/prawn/measurements.rb, line 33
def pt2pt(pt)
  pt
end
yd2in(yd) click to toggle source
# File lib/prawn/measurements.rb, line 28
def yd2in(yd)
  yd * 36
end
yd2pt(yd) click to toggle source
# File lib/prawn/measurements.rb, line 45
def yd2pt(yd)
  in2pt(yd2in(yd))
end