Class TCSSUnitConverter

Unit

Declaration

type TCSSUnitConverter = class(TObject)

Description

Converter for CSS units

Hierarchy

Overview

Fields

Protected FCurrentFontEmHeight: TFloatWithCSSUnit;
Protected FViewBoxHeight: TFloatWithCSSUnit;
Protected FViewBoxHeightInUnit: array[TCSSUnit] of single;
Protected FViewBoxWidth: TFloatWithCSSUnit;
Protected FViewBoxWidthInUnit: array[TCSSUnit] of single;

Methods

Public constructor Create;
Public function Convert(xy: single; sourceUnit, destUnit: TCSSUnit; dpi: single; containerSize: single = 0): single;
Public function ConvertCoord(pt: TPointF; sourceUnit, destUnit: TCSSUnit; containerWidth: single; containerHeight: single): TPointF; overload;
Public function ConvertCoord(pt: TPointF; sourceUnit, destUnit: TCSSUnit): TPointF; overload;
Public function ConvertHeight(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit): ArrayOfTFloatWithCSSUnit; overload;
Public function ConvertHeight(y: single; sourceUnit, destUnit: TCSSUnit; containerHeight: single): single; overload;
Public function ConvertHeight(y: single; sourceUnit, destUnit: TCSSUnit): single; overload;
Public function ConvertHeight(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit; containerHeight: single): ArrayOfTFloatWithCSSUnit; overload;
Public function ConvertHeight(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;
Public function ConvertHeight(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerHeight: single): TFloatWithCSSUnit; overload;
Public function ConvertOrtho(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single; containerHeight: single): TFloatWithCSSUnit; overload;
Public function ConvertOrtho(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;
Public function ConvertOrtho(xy: single; sourceUnit, destUnit: TCSSUnit): single; overload;
Public function ConvertWidth(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single): ArrayOfTFloatWithCSSUnit; overload;
Public function ConvertWidth(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single): TFloatWithCSSUnit; overload;
Public function ConvertWidth(x: single; sourceUnit, destUnit: TCSSUnit; containerWidth: single): single; overload;
Public function ConvertWidth(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit): ArrayOfTFloatWithCSSUnit; overload;
Public function ConvertWidth(x: single; sourceUnit, destUnit: TCSSUnit): single; overload;
Public function ConvertWidth(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;
Public class function formatValue(AValue: ArrayOfTSVGNumber; APrecision: integer = 7): string; overload; static;
Public class function formatValue(AValue: TFloatWithCSSUnit; APrecision: integer = 7): string; overload; static;
Public class function formatValue(AValue: single; APrecision: integer = 7): string; overload; static;
Public class function formatValue(AValue: ArrayOfTFloatWithCSSUnit; APrecision: integer = 7): string; overload; static;
Public function GetConversionMatrix(AFromUnit, AToUnit: TCSSUnit; containerWidth: single; containerHeight: single): TAffineMatrix; overload;
Public function GetConversionMatrix(AFromUnit, AToUnit: TCSSUnit): TAffineMatrix; overload;
Public class function parseArrayOfNumbers(AValue: string): ArrayOfTSVGNumber; overload; static;
Public class function parseArrayOfValuesWithUnit(AValue: string): ArrayOfTFloatWithCSSUnit; overload; static;
Public class function parseValue(AValue: string; ADefault: single): single; overload; static;
Public class function parseValue(AValue: string; ADefault: TFloatWithCSSUnit): TFloatWithCSSUnit; overload; static;
Protected function GetDefaultUnitHeight: TFloatWithCSSUnit; virtual;
Protected function GetDefaultUnitWidth: TFloatWithCSSUnit; virtual;
Protected function GetDpiX: single; virtual;
Protected function GetDpiY: single; virtual;
Protected function GetFontEmHeight: TFloatWithCSSUnit; virtual;
Protected function GetFontXHeight: TFloatWithCSSUnit; virtual;
Protected function GetRootFontEmHeight: TFloatWithCSSUnit;
Protected procedure SetViewBoxHeight(AValue: TFloatWithCSSUnit);
Protected procedure SetViewBoxWidth(AValue: TFloatWithCSSUnit);

Properties

Public property CurrentFontEmHeight: TFloatWithCSSUnit read FCurrentFontEmHeight write FCurrentFontEmHeight;
Protected property DefaultUnitHeight: TFloatWithCSSUnit read GetDefaultUnitHeight;
Protected property DefaultUnitWidth: TFloatWithCSSUnit read GetDefaultUnitWidth;
Public property DpiX: single read GetDpiX;
Public property DpiY: single read GetDpiY;
Protected property FontEmHeight: TFloatWithCSSUnit read GetFontEmHeight;
Protected property FontXHeight: TFloatWithCSSUnit read GetFontXHeight;
Public property RootFontEmHeight: TFloatWithCSSUnit read GetRootFontEmHeight;
Public property ViewBoxHeight: TFloatWithCSSUnit read FViewBoxHeight write SetViewBoxHeight;
Public property ViewBoxWidth: TFloatWithCSSUnit read FViewBoxWidth write SetViewBoxWidth;

Description

Fields

Protected FCurrentFontEmHeight: TFloatWithCSSUnit;

This item has no description.

Protected FViewBoxHeight: TFloatWithCSSUnit;

This item has no description.

Protected FViewBoxHeightInUnit: array[TCSSUnit] of single;

This item has no description.

Protected FViewBoxWidth: TFloatWithCSSUnit;

This item has no description.

Protected FViewBoxWidthInUnit: array[TCSSUnit] of single;

This item has no description.

Methods

Public constructor Create;

This item has no description.

Public function Convert(xy: single; sourceUnit, destUnit: TCSSUnit; dpi: single; containerSize: single = 0): single;

This item has no description.

Public function ConvertCoord(pt: TPointF; sourceUnit, destUnit: TCSSUnit; containerWidth: single; containerHeight: single): TPointF; overload;

This item has no description.

Public function ConvertCoord(pt: TPointF; sourceUnit, destUnit: TCSSUnit): TPointF; overload;

This item has no description.

Public function ConvertHeight(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit): ArrayOfTFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertHeight(y: single; sourceUnit, destUnit: TCSSUnit; containerHeight: single): single; overload;

This item has no description.

Public function ConvertHeight(y: single; sourceUnit, destUnit: TCSSUnit): single; overload;

This item has no description.

Public function ConvertHeight(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit; containerHeight: single): ArrayOfTFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertHeight(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertHeight(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerHeight: single): TFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertOrtho(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single; containerHeight: single): TFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertOrtho(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertOrtho(xy: single; sourceUnit, destUnit: TCSSUnit): single; overload;

This item has no description.

Public function ConvertWidth(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single): ArrayOfTFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertWidth(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit; containerWidth: single): TFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertWidth(x: single; sourceUnit, destUnit: TCSSUnit; containerWidth: single): single; overload;

This item has no description.

Public function ConvertWidth(AValue: ArrayOfTFloatWithCSSUnit; destUnit: TCSSUnit): ArrayOfTFloatWithCSSUnit; overload;

This item has no description.

Public function ConvertWidth(x: single; sourceUnit, destUnit: TCSSUnit): single; overload;

This item has no description.

Public function ConvertWidth(AValue: TFloatWithCSSUnit; destUnit: TCSSUnit): TFloatWithCSSUnit; overload;

This item has no description.

Public class function formatValue(AValue: ArrayOfTSVGNumber; APrecision: integer = 7): string; overload; static;

This item has no description.

Public class function formatValue(AValue: TFloatWithCSSUnit; APrecision: integer = 7): string; overload; static;

This item has no description.

Public class function formatValue(AValue: single; APrecision: integer = 7): string; overload; static;

This item has no description.

Public class function formatValue(AValue: ArrayOfTFloatWithCSSUnit; APrecision: integer = 7): string; overload; static;

This item has no description.

Public function GetConversionMatrix(AFromUnit, AToUnit: TCSSUnit; containerWidth: single; containerHeight: single): TAffineMatrix; overload;

This item has no description.

Public function GetConversionMatrix(AFromUnit, AToUnit: TCSSUnit): TAffineMatrix; overload;

This item has no description.

Public class function parseArrayOfNumbers(AValue: string): ArrayOfTSVGNumber; overload; static;

This item has no description.

Public class function parseArrayOfValuesWithUnit(AValue: string): ArrayOfTFloatWithCSSUnit; overload; static;

This item has no description.

Public class function parseValue(AValue: string; ADefault: single): single; overload; static;

This item has no description.

Public class function parseValue(AValue: string; ADefault: TFloatWithCSSUnit): TFloatWithCSSUnit; overload; static;

This item has no description.

Protected function GetDefaultUnitHeight: TFloatWithCSSUnit; virtual;

This item has no description.

Protected function GetDefaultUnitWidth: TFloatWithCSSUnit; virtual;

This item has no description.

Protected function GetDpiX: single; virtual;

This item has no description.

Protected function GetDpiY: single; virtual;

This item has no description.

Protected function GetFontEmHeight: TFloatWithCSSUnit; virtual;

This item has no description.

Protected function GetFontXHeight: TFloatWithCSSUnit; virtual;

This item has no description.

Protected function GetRootFontEmHeight: TFloatWithCSSUnit;

This item has no description.

Protected procedure SetViewBoxHeight(AValue: TFloatWithCSSUnit);

This item has no description.

Protected procedure SetViewBoxWidth(AValue: TFloatWithCSSUnit);

This item has no description.

Properties

Public property CurrentFontEmHeight: TFloatWithCSSUnit read FCurrentFontEmHeight write FCurrentFontEmHeight;

This item has no description.

Protected property DefaultUnitHeight: TFloatWithCSSUnit read GetDefaultUnitHeight;

This item has no description.

Protected property DefaultUnitWidth: TFloatWithCSSUnit read GetDefaultUnitWidth;

This item has no description.

Public property DpiX: single read GetDpiX;

This item has no description.

Public property DpiY: single read GetDpiY;

This item has no description.

Protected property FontEmHeight: TFloatWithCSSUnit read GetFontEmHeight;

This item has no description.

Protected property FontXHeight: TFloatWithCSSUnit read GetFontXHeight;

This item has no description.

Public property RootFontEmHeight: TFloatWithCSSUnit read GetRootFontEmHeight;

This item has no description.

Public property ViewBoxHeight: TFloatWithCSSUnit read FViewBoxHeight write SetViewBoxHeight;

This item has no description.

Public property ViewBoxWidth: TFloatWithCSSUnit read FViewBoxWidth write SetViewBoxWidth;

This item has no description.