2 Introduction to SVG
This section will provide an introduction to the various concepts, approaches and features
that make up SVG. It will probably be quite lengthy. So far, only four introductory
sections have been written:
2.1 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.
Here are some of the ways which SVG fits in and conforms to other standards:
- SVG is an application of XML 1.0 (??? add link)
- SVG conforms to the XML Namespace Recommendation (??? add link)
- SVG will conform with XLink and XPointer (once these specifications become recommendations) (??? add links)
- SVG conforms to Cascading Style Sheets (CSS) level 2 (??? add link)
- SVG conforms to Document Object Model (DOM) level 1 (??? add link)
- SVG attempts to fit in with HTML version 4 and is meant to serve as a component
grammar for future versions of HTML expressed as a set of component XML grammars
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 HTML and SVG.
Thus, interactive and dynamic effects will be possible on both HTML and SVG using the same
set of scripts.
2.2 Two Indended Uses: Documents and Fragments
SVG supports two intended uses:
- Stand-alone SVG files which represent complete drawings.
These stand-alone SVG files might have been created by a
graphics authoring program. If destined to be part of a
Web page, these files might be included/referenced using XPointer
by a parent document such as an XML Web page.
- SVG "fragments" which represent snippets of graphics
which are interspersed (often inline) among the content of
a parent document such as an XML Web page.
The following shows a trivial stand-alone SVG file with no content:
<!-- Insert drawing elements here -->
The simplest drawings can be described by a sequence of drawing elements.
The following example draws a rectangle:
<rectangle x="100" y="100" width="100" height="100" />
The following shows how a fragment from the SVG namespace could be
interspersed into a parent XML grammar:
<svg:rectangle ... />
2.3 Accessibility Features
Drawings done in SVG will be much more accessible that drawings done as image formats
for the following reasons:
- Text strings in SVG are represented as regular XML character data rather than bits in an image.
- At any place in the SVG hierarchy, a drawing can include a long set of
and/or a short description
in the form of a title. Both of these features can be used to help the visually
impaired interpret both the intent and specific content of a drawing. The drawing
can be architected such that there is a single description for the drawing as a whole
or there are multiple descriptions which are distributed within the drawing
and describe each separate component within the drawing.
- Because of SVG's support of Cascading Style Sheets Level 2 (??? need to add link),
there will be the ability to set up personal style sheets to adjust the color
contrast of graphic elements.
(Reliable delivery of fonts is considered a critical requirement for SVG. Designers
should be able to create SVG graphics with whatever fonts they care to use and then the
same fonts should appear in the end user's browser when viewing an SVG drawing,
even if the given end user hasn't purchased the fonts in question. This parallels
the print world, where the designer uses a given font when authoring a drawing for print,
but when the end user views the same drawing within a magazine the text appears with the correct font.
The current plan for SVG is to rely on CSS2's Web font facility for delivery of
font data to end users.
A companion approach would be add a simple font facility
directly into SVG so that SVG drawings could carry around their
own font data. Currently, this simple font facility is not part of SVG.
The SVG working group is particularly interested in public feedback on SVG's
approach to fonts.)