Text

SVG text elements often resemble straightforward text elements in HTML. Font styles and colors are defined as style properties. As long as there is no custom kerning or binding to a path within the text string, the text is kept together inside these tags, just as in HTML. This allows for very simple edits to text content, as well as easy scriptability for dynamic text generation and manipulation.

Text properties also include position coordinates that define the relative position of the text element within the bounding box.

(When creating a text element in Adobe Illustrator, set "kerning" to "0" in the character palette to export contiguous blocks of text.)

Choose any of the fonts in the list below, then click the Set button to change the text font:

font-family: 

view JavaScript

Enter text in the field below to replace the text in the SVG image, then click the Set button:

enter text: 

view JavaScript

SVG images are not limited to fonts installed in the user's system. Illustrator 9 can convert Type 1 and TrueType fonts to CEF (Compact Embedded Font) fonts that can be embedded within the SVG file.

The example below includes an embedded font.

With the capacity to embed Type 1 fonts, SVG images contain not only searchable and customizable text content, but text rendered and printable in any Type 1 font the designer wants.

Next lesson: Cascading Style Sheets

Copyright ©2000 Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy