Class HTMLPurifier_UnitConverter
Class for converting between different unit-lengths as specified by CSS.
public
|
#
__construct( mixed $output_precision = 4, mixed $internal_precision = 10, mixed $force_no_bcmath = false )
|
public
|
#
convert(
Converts a length object of one unit into another unit. |
public
integer
|
integer |
ENGLISH
|
1 |
|
integer |
METRIC
|
2 |
|
integer |
DIGITAL
|
3 |
protected static
array
|
$units | array(
self::ENGLISH => array(
'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary
'pt' => 4,
'pc' => 48,
'in' => 288,
self::METRIC => array('pt', '0.352777778', 'mm'),
),
self::METRIC => array(
'mm' => 1,
'cm' => 10,
self::ENGLISH => array('mm', '2.83464567', 'pt'),
),
) |
#
Units information array. Units are grouped into measuring systems (English, Metric), and are assigned an integer representing the conversion factor between that unit and the smallest unit in the system. Numeric indexes are actually magical constants that encode conversion data from one system to the next, with a O(n2) constraint on memory (this is generally not a problem, since the number of measuring systems is small.) |
protected
mixed
|
$outputPrecision |
|
#
Minimum bcmath precision for output. |
protected
mixed
|
$internalPrecision |
|
#
Bcmath precision for internal calculations. |