SVG text with Read Aloud in iBooks

From MobileRead
Jump to: navigation, search

Many children's books or illustrated non-fiction titles utilize highly designed text that follows a curved path, especially for chapter headings. In the iBooks technical specification it is recommended that an SVG text path is used for such a feature. Although it is not specifically mentioned in the spec, it is perfectly possible, and very easy to use the SVG text paths in conjunction with iBooks' Read Aloud feature. Only a few minor adjustments are needed in the SVG code.


Contents

[edit] Marking up the SVG code

Interestingly, I found that the Read Aloud highlighting also appears to work with the path itself. You could potentially use this ability to highlight or change the color of shapes on the page, which I can imagine being useful for some children's books.

[edit] Example

   <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="250px" height="250px" viewBox="20 20 230 230">
        <path id="TextPath1" fill="none" stroke="none" d="M60.456,117.962c0-34.988,28.363-63.351,63.352-63.351c34.987,0,63.353,28.363,63.353,63.351"/>
        <text>
            <textPath xlink:href="#TextPath1">
            <tspan id="word1" fill="currentColor">Read</tspan> <tspan id="word2" fill="currentColor">Aloud!</tspan>
            </textPath>
        </text>
    </svg>

[edit] Things that don't work

[edit] Further info

Personal tools
Namespaces
Variants
Actions
Navigation
MobileRead Networks
Toolbox
Advertisement