Skip to content
shairontoledo edited this page Sep 13, 2010 · 1 revision

The postscript default unit is 1 pixel/72 inch. RGhost uses centimeters (cm) as its default, mainly for positioning coordinates and numeric object sizes (if the size is a String, it won’t be parsed to the default unit).

This setting can be changed setting the value of RGhost::Config::GS[:unit] before the document is created using any of the Units child classes. Example:

Setting to inches.

RGhost::Config::GS[:unit]=Units::Inch
doc=RGhost::Document.new
doc.moveto :x => 1, :y => 2  #1 inch  x e 2 inches  y

Explicitly setting to Cm.
doc.moveto :x => '1 cm' , :y => '2 cm'

or using the Postscript unit
doc.moveto :x => '100' , :y => '200'