SVG Text Layout

Example code for the O’Reilly Media book

by Amelia Bellamy-Royds & Kurt Cagle

SVG Text Basics

Chapter 2 introduces the SVG <text> element and the basic attributes for positioning simple text labels within a graphic, including the particular issues of sizing text within a scalable coordinate system.

The links below will open the live example files or high-res PNG or JPEG screenshots in a new browser tab. Alternatively, you can download the entire collection as a zip archive or fork it as a GitHub repository. Be sure to read the O’Reilly Media policy on the use of example code.

Return to the main table of contents.