SVG 1.1: What is a “user block” and how to convert a user block to an absolute unit (for example: millimeter)?

I am using SVG Tiny 1.1 and it’s hard for me to understand the concept of “user unit”.

The SVG 1.1 specification defines each <length> without a specific element (for example, "mm", "cm", "pt", etc.) to be in the "user block".

When implementing the "SVGLength" interface, I came across 4 attributes associated with a length value; value, unityType, valueInSpecifiedUnit, valueAsString. The last 3 attributes are clear enough for me.

  • valueInSpecifiedUnitis in block type unitType.
  • valueAsStringequals valueInSpecifiedUnit+ unitTypestring value. For example: "10 mm"

However, the attribute value is specified in the user block. So my questions are:

  • What is a custom block?
  • how to convert from “user unit” to “absolute unit”, for example millimeter (mm)?

Hi,

+5
source share
1 answer

The specification says :

custom units

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

also:

width height svg ( ), "px"

, , svg, , .

SVG.

+7

All Articles