1 Introduction to SVG


1.1 About SVG

This specification defines the features and syntax for Scalable Vector Graphics (SVG).

SVG is a language for describing two-dimensional graphics in XML. SVG allows for three types of graphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text. Graphical objects can be grouped, styled, transformed and composited into previously rendered objects. The feature set includes nested transformations, clipping paths, alpha masks, filter effects and template objects.

SVG drawings can be interactive and dynamic. Animations can be defined and triggered either declaratively (i.e., by embedding SVG animation elements in the SVG document) or via scripting.

Sophisticated applications of SVG are possible by use of supplemental scripting language with access to SVG's Document Object Model (DOM), which provides complete access to all elements, attributes and properties. A rich set of event handlers such as onmouseover and onclick can be assigned to any SVG graphical object. Because of its compatibility and leveraging of other Web standards, features like scripting can be done on XHTML and SVG elements simultaneously within the same Web page.


1.2 SVG MIME Type

The MIME type for SVG will be "image/svg". The W3C will register this MIME type around the time which SVG is approved as a W3C Recommendation.

1.3 Compatibility with Other Standards Efforts

SVG leverages and integrates with other W3C specifications and standards efforts. By leveraging and conforming to other standards, SVG becomes more powerful and makes it easier for users to learn how to incorporate SVG into their Web sites.

The following describes some of the ways in which SVG maintains compatibility with, leverages and integrates with other W3C efforts:

Because SVG conforms to DOM, it will be scriptable just like HTML version 4 (sometimes called DHTML). This will allow a single scripting approach to be used simultaneously for both XML documents and SVG graphics. Thus, interactive and dynamic effects will be possible on multiple XML namespaces using the same set of scripts.

1.4 Terminology

basic shape
Standard shapes which are predefined in SVG as a convenience for common graphical operations. Specifically: <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>,
canvas
a surface onto which graphics elements are drawn, which can be real physical media such as a display or paper or an abstract surface such as a allocated region of computer memory. See the discussion of the SVG document canvas in the chapter on Coordinate Systems, Transformations and Units.
clipping path
a combination of <path>, <text> and basic shapes which serve as the outline of a (in the absense of antialiasing) 1-bit mask, where everything on the "inside" of the outline is allowed to show through but everything on the outside is masked out. See Clipping paths.
container element
An element which can have graphics elements and other container elements as child elements. Specifically: <svg>, <g>, <defs> <symbol>, <clipPath>, <mask>, <pattern>, <marker>, <a> and <switch>.
current transformation matrix (CTM)
Transformation matrices define the mathematical mapping from one coordinate system into another using a 3x3 matrix using the equation [x' y' 1] = [x y 1] * matrix. The current transformation matrix (CTM) defines the mapping from the user coordinate system into the viewport coordinate system. See Establishing A New User Coordinate System: Transformations
fill
The operation of painting the interior of a shape or the interior of the character glyphs in a text string.
graphics element
One of the element types that can cause graphics to be drawn onto the target canvas. Specifically: <path>, <text>, <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <image> and <use>.
graphics referencing element
A graphics element which uses a reference to a different document or element as the source of its graphical content. Specifically: <use> and <image>.
local URI reference
A Uniform Resource Identifier [URI] that does not include an <absoluteURI> or <relativeURI> and thus represents a reference to an element/fragment within the current document. See References and the <defs> element.
mask
a container element which can contain graphics elements or other container elements which define a set of graphics that is to be used as a semi-transparent mask for compositing foreground objects into the current background. See Masks.
non-local URI reference
A Uniform Resource Identifier [URI] that includes an <absoluteURI> or <relativeURI> and thus (usually) represents a reference to a different document or an element/fragment within a different document. See References and the <defs> element.
number
A real number (??? provide exact BNF)
paint
A paint represents a way of putting color values onto the canvas. A paint might consists of both color values and associated alpha values which control the blending of colors against already existing color values on the canvas. SVG supports three types of built-in paint: color, gradients and patterns.
shape
A graphics element that is defined by some combination of straight lines and curves. Specifically: <path>, <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>,
stroke
The operation of painting the outline of a shape or the outline of character glyphs in a text string.
SVG document canvas
the canvas onto which the SVG document is rendered. See the discussion of the SVG document canvas in the chapter on Coordinate Systems, Transformations and Units.
SVG document viewport
the viewport within the SVG document canvas which defines the rectangular region into which the SVG document is rendered. See the discussion of the SVG document viewport in the chapter on Coordinate Systems, Transformations and Units.
transformation
A modification of the current transformation matrix (CTM) by providing a supplemental transformation in the form of a set of simple transformations specifications (such as scaling, rotation or translation) and/or one or more transformation matrices. See Establishing A New User Coordinate System: Transformations
transformation matrix
Transformation matrices define the mathematical mapping from one coordinate system into another using a 3x3 matrix using the equation [x' y' 1] = [x y 1] * matrix. See current transformation matrix (CTM) and Establishing A New User Coordinate System: Transformations
URI Reference
A Uniform Resource Identifier [URI] which serves as a reference to a file or to an element/fragment within a file. See References and the <defs> element.
user coordinate system
In general, a coordinate system defines locations and distances on the current canvas. The current user coordinate system is the coordinate system that is currently active and which is used to define how coordinates and lengths are located and computed, respectively, on the current canvas. See initial user coordinate system and Establishing A New User Coordinate System: Transformations.
user space
A synonym for user coordinate system.
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.
viewport
a rectangular region within the current canvas onto which graphics elements are to be rendered. See the discussion of the SVG document viewport in the chapter on Coordinate Systems, Transformations and Units.
viewport coordinate system
In general, a coordinate system defines locations and distances on the current canvas. The viewport coordinate system is the coordinate system that is active at the start of processing of an <svg> element, before processing the optional fitBoxToViewport attribute. In the case of an SVG document that is embedded within a parent document which uses CSS to manage its layout, then the viewport coordinate system will have the same orientation and lengths as in CSS, with the origin at the top-left on the viewport. See Establishing the initial viewport and Establishing a New Viewport: the <svg> element within an SVG document.
viewport space
A synonym for viewport coordinate system.
viewport units
A coordinate value or length expressed in viewport units represents a coordinate value or length in the viewport coordinate system. Thus, 10 viewport units represents a length of 10 units in the viewport coordinate system.