mapbox/carto — pull request #240 by stefanklug (2013-01-21 16:08:57+00:00)
Title: Add unit support to css

Hi, as long as there is no support for units like m, mm, pt in mapnik, I would like to propose this ptach. It adds support for the units m, cm, mm, pt, pc. These are converted to pixels by the renderer. The conversion is done based on a global dpi setting, which defaults to 90.714 and can be manually set by passing it to the carto renderer.

There is a small backwards incompatible change regarding the handling of %
Old behaviour:
1px + 10% = 11px
10% + 1px = 11%
2px * 10% = 20px

New behaviour:
1px + 10% = 1.1px
10% + 1px = parser error (This is not perfectly clean, as an addition should be commutative, but it feels right)
2px * 10% = parser error

A new parameter --dpi is added to the carto bin. While doing this change I migrated the command line handling code to use optimist.