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 the following introductory sections have been written:

2.1 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.

2.2 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:

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.

2.3 Two Indended Uses: Documents and Fragments

SVG supports two intended uses:

The following shows a trivial stand-alone SVG file with no content:

<?xml version="1.0" standalone="yes"?>
<svg width="4in" height="3in"
 xmlns = 'http://www.w3.org/Graphics/SVG/svg-19990412.dtd'>
 <!-- Insert drawing elements here -->

Download this example

The simplest drawings can be described by a sequence of drawing elements. The following example draws a rectangle:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" 
<svg width="4in" height="3in">
  <desc>This is a rectangle
    <rect x="20" y="30" width="100" height="80"/>

Download this example

The following shows how a fragment from the SVG namespace could be interspersed into a parent XML grammar:

<?xml version="1.0"?>
<ABC xmlns="http://parent.name.space"
  <!-- document in the parent namespace -->
  <svg:svg width="40%" height="40%">
     <svg:rectangle width="43.6" height="31.5"/>
     <!-- svg graphic continues -->
   <!-- document in parent namespace continues -->

Download this example

2.4 Accessibility Features

Drawings done in SVG will be much more accessible that drawings done as image formats for the following reasons:

2.5 Fonts

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 WebFont 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.