O'Reilly logo

Java™ Drawing with Apache Batik: A Tutorial by Alexander Kolesnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Text on A Path

SVG gives us the ability to draw text along a path. However, to do this, you first need to understand how paths are defined.

Paths in SVG

You use the path element to specify a path. The d attribute of the path element contains data that specifies how the path should be drawn. Each step in path data starts from a letter, usually followed by numbers. The letter specifies a command, i.e. which action should be taken on this step. Table 6.1 lists some of the available commands.

Table 6.1. Some of the available commands for specifying a path
CommandDescription
MMoves your drawing tool to the specified point (without actually drawing anything).
LDraws a line to the specified point.
CDraws a cubic Bézier curve using the data specified after ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required