Thread: SVG for iBooks?
View Single Post
Old 01-02-2013, 08:19 PM   #6
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by FunkeXMix View Post
You are right, I need to embed the code into html. Forced hyphenation is a part of the design as you see in the picture I attached earlier. That will of course make any search fail since the text is divided. My solution for this is to output it as outlines/graphics instead of text and then add a small piece of svg text code positioned in the read area with the same color so it is invisible but searchable. I am hoping this will work with the VoiceOver feature that iBooks requires to work with their eBooks as stated in the iBooks Assets Guide as well.
I think you're making this way too hard. Searching should work as long as the entire text of a single word or phrase falls within the same <text> element. You can use more than one <tspan> element within that element to draw each part of the word. If you do it that way, searching should "just work".

In other words, the easiest way to do what you are doing is this:

Code:
<text>
    <!-- Draw each piece of the word/string -->
    <tspan ...>antidis</tspan>
    <tspan ...>establish</tspan>
    <tspan ...>mentar</tspan>
    <tspan ...>ianism</tspan>
</text>
<text>
    <!-- Draw the hyphens -->
    <tspan ...>-</tspan>
    <tspan ...>-</tspan>
    <tspan ...>-</tspan>
</text>
dgatwood is offline   Reply With Quote