O'Reilly logo

SVG Text Layout by Kurt Cagle, Amelia Bellamy-Royds

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

Chapter 7. Anchoring in International Waters

Think you’ve got a handle on SVG text alignment now? Not too complicated, is it? (Is it?) Maybe you’re wondering, though, why the text-anchor keywords are not simply left, center, and right. It’s a good question, and the start of a whole other level of complication.

The examples in the book so far have used English text, laid out left to right the way English text normally is. However, other languages arrange text right to left or top to bottom. Even within English and other Western languages, you may want to use vertical text to fit within the layout of a chart or diagram, or for artistic effect.

SVG includes a number of features to support alternative text modes, and this chapter and the next explain how they are supposed to work. However, some of the features were not well designed, and most are not well implemented in web browsers at the time of writing. These chapters therefore contain many warnings about browser incompatibilities. Where practical, they also offer suggestions for workarounds.

If you are developing designs that use non-Western languages, you will want to test your code thoroughly in any software you need to support.

You can also get involved to make things better in the future: provide feedback on web standards in development, and file bug reports and feature requests with browsers. Many developers involved in SVG and CSS have limited experience with non-European languages. Even if all you can do is provide practical ...

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