Show/Hide Toolbars

RiverSoftAVG Products Help

Defines the SVG Length type, including its Raw value, Unit, and whether it is a percentage. The RSSVGTypes.TSVGLength.Raw value represents the length in the current unit (e.g., inch, centimeter, etc); the RSSVGTypes.TSVGLength.Pixels and RSSVGTypes.TSVGLength.Value properties display the length converted to pixels. This allows you to set the length to 2 inches. Then, depending on what the RSSVGTypes.TSVGLength.GetUnitFactors method returns for pixels per inch, the Pixels property can change.

In SVGs, a length is a distance measurement, given as a number along with a unit which may be optional. Lengths are specified in one of two ways depending upon whether they are used in CSS property syntax or SVG presentation attribute syntax:

When a <length> is used in a style sheet or with a property in a ‘style’ attribute, the syntax must match the following pattern:
 
length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")?
See the CSS2 specification for the meanings of the unit identifiers. The unit identifier may be in lower (recommended) or upper case.
 
For properties defined in CSS2 [CSS2], a length unit identifier must be provided (for non-zero values). For SVG-specific properties, the length unit identifier is optional. If a unit is not provided, the length value represents a distance in the current user coordinate system.

When a <length> is used in an SVG presentation attribute, the syntax must match the following pattern:
 
length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?
The unit identifier, if present, must be in lower case; if not present, the length value represents a distance in the current user coordinate system.
 
Note that the non-property <length> definition also allows a percentage unit identifier. The meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. Two common cases are: (a) when a percentage length value represents a percentage of the viewport width or height (refer to the section that discusses units in general), and (b) when a percentage length value represents a percentage of the bounding box width or height on a given object (refer to the section that describes object bounding box units).

Namespace: RSSVGTypes

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb