f-office-units 0.2.2

Integer lengths and unit conversions for F-Office.
Documentation
//! The scales of the whole numbers that Office Open XML writes for lengths in other units,
//! shares, angles and line spacing (ECMA-376 Part 1, 17.18 and 20.1.10). Each constant is the
//! number of steps in one whole unit.

/// Twips in one inch.
pub const TWIPS_PER_INCH: i64 = 1_440;

/// Twips in one point.
pub const TWIPS_PER_POINT: i64 = 20;

/// EMU in one inch, the unit of the lengths of DrawingML.
pub const EMUS_PER_INCH: i64 = 914_400;

/// Tenths of a millimeter in one inch.
pub const TENTHS_OF_MM_PER_INCH: i64 = 254;

/// Tenths of a millimeter in one centimeter.
pub const TENTHS_OF_MM_PER_CM: i64 = 100;

/// Tenths of a millimeter in one meter.
pub const TENTHS_OF_MM_PER_M: i64 = 10_000;

/// Tenths of a millimeter in one millimeter.
pub const TENTHS_OF_MM_PER_MM: i64 = 10;

/// Points in one inch.
pub const POINTS_PER_INCH: i64 = 72;

/// Points in one pica.
pub const POINTS_PER_PICA: i64 = 12;

/// Steps of one tenth in a whole.
pub const TENTHS: i64 = 10;

/// Steps of one percent in a whole.
pub const PERCENT: i64 = 100;

/// Steps of one thousandth in a whole, the scale of decimals that the readers keep.
pub const THOUSANDTHS: i64 = 1_000;

/// The decimal digits of a thousandth.
pub const THOUSANDTHS_DIGITS: usize = 3;

/// Steps of one fiftieth of a percent in one percent, the unit of table widths in percent
/// (`ST_MeasurementOrPercent`).
pub const FIFTIETHS_PER_PERCENT: i64 = 50;

/// A whole DrawingML percentage (`ST_Percentage` and `ST_PositivePercentage`), in thousandths
/// of a percent.
pub const DRAWING_WHOLE: i64 = 100_000;

/// One degree of a DrawingML angle (`ST_Angle`), in 60,000ths of a degree.
pub const DEGREE: i64 = 60_000;

/// A whole turn of a DrawingML angle (`ST_Angle`), in 60,000ths of a degree.
pub const FULL_TURN: i64 = 21_600_000;

/// A quarter turn of a DrawingML angle, 90 degrees, in 60,000ths of a degree.
pub const QUARTER_TURN: i64 = 5_400_000;

/// One line of automatic line spacing (`w:spacing w:line` with `w:lineRule="auto"`), in 240ths
/// of a line.
pub const LINE: i64 = 240;

/// The half-points of a font size in one point.
pub const HALF_POINTS_PER_POINT: i64 = 2;