View Single Post
Old 05-04-2015, 05:10 PM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by John123 View Post
What would be the best way to introduce the SVG file into that senario. Bear in mind there are 270+ images to insert and I'm doing this as a favour. So don't want to spend too much time on it.
If I were in your shoes, I'd simply hide all Chinese characters, because they don't add any value to the book and Chinese speakers can probably handle the simplified Pinyin text even though it lacks tone markers.

If that's not an option, I'd to the following:

1. Use this simple Sigil plugin to add consecutive ids to all Chinese-Logograms spans. (Enter span in the Tag box, class in the Attribute box and Chinese-Logograms in the Value box)

2. Generate all Chinese svg files using the incremental ids as the file name. I.e., I'd generate chinese1.svg for <span id="chinese1" class="Chinese-Logograms"> ... </span> etc.

3. Use a regular expression in Sigil to replace the Chinese-Logograms spans with an image reference based on the span id value. (If you plan to upload the book to several bookstores, you could of course keep the Chinese-Logograms spans and hide the images or vice versa, depending on the app/device.)

You'll obviously also need to add a style for inline svg images and fine-tune the vertical-align and height properties of the svg images.
Doitsu is offline   Reply With Quote