SVG 1.1 : What is “user unit” and how to convert user unit into absolute unit(eg: millimeter)?

前端 未结 1 1437
死守一世寂寞
死守一世寂寞 2021-02-06 07:06

I am implementing SVG Tiny 1.1 and I am having trouble understanding the \"user unit\" concept.

SVG 1.1 specification defines every with no specified u

1条回答
  •  长情又很酷
    2021-02-06 07:29

    The spec says:

    user units

    A coordinate value or length expressed in user units represents a coordinate value or length in the current user coordinate system. Thus, 10 user units represents a length of 10 units in the current user coordinate system.

    Also:

    if the ‘width’ or ‘height’ attributes on the outermost svg element are in user units (i.e., no unit identifier has been provided), then the value is assumed to be equivalent to the same number of "px" units

    which means that user units are the units specified in the outermost svg element's width and height attributes, and if they are not specified, then user units are pixels.

    Read the section on units in SVG.

    0 讨论(0)
提交回复
热议问题