Table of Contents

Enum LengthUnit

Namespace
SVGImage.SVG.Shapes
Assembly
DotNetProjects.SVGImage.dll
public enum LengthUnit

Fields

Inches = 7

inches 1in = 2.54cm = 96px

Number = 0

No unit specified, interpreted as a value in pixels.

Percent = 1

Percent is relative to least distant viewbox dimensions. If the length is inherently horizontal, like "dx", then the percentage is relative to the least distant viewbox width. If the length is inherently vertical, like "dy", then the percentage is relative to the least distant viewbox height. Otherwise the percentage is relative to the least distant viewbox diagonal.

Setting a unit of Percent may be converted into PercentWidth, PercentHeight, or PercentDiagonal

PercentDiagonal = 19

Percentage is relative to the least distant viewbox diagonal

PercentHeight = 18

Percentage is relative to the least distant viewbox height.

PercentWidth = 17

Percentage is relative to the least distant viewbox width.

Q = 10

quarter-millimeters 1Q = 1/40th of 1cm

Unknown = -1

A unit was detected but not recgonized.

ch = 11

Relative to character advance of the “0” (ZERO, U+0030) glyph in the element’s font

cm = 5

centimeters 1cm = 96px/2.54

em = 2

Relative to font size of the element

ex = 3

Relative to x-height of the element’s font

mm = 6

millimeters 1mm = 1/10th of 1cm

pc = 9

picas 1pc = 1/6th of 1in

pt = 8

points 1pt = 1/72nd of 1in

px = 4

pixels 1px = 1/96th of 1in

rem = 12

Relative to font size of the root element

vh = 14

Relative to 1% of viewport’s height

vmax = 16

Relative to 1% of viewport’s larger dimension

vmin = 15

Relative to 1% of viewport’s smaller dimension

vw = 13

Relative to 1% of viewport’s width

Remarks

Child elements do not inherit the relative values as specified for their parent; they inherit the computed values. Values from Unknown to pc are 1 less than as defined in the SVG 1.1 SVG_LENGTHTYPE specification. This is so Number can be used as the default.