Hi
A brand new plugin allows us to create svg wrappers with Sigil. It's the same technique as the one used by Calibre for cover pages. However as it applies for any image we may find in the text, one naturally thinks as to how make it work with a
caption.
This question is about how to insert (integrate?) inside a svg wrapper a text field containing a caption so as the two fit together in the same page.
Rationale
When one adds images to one EPUB, many of them have captions. and it has always been tricky to find the right balance and be confident that the caption will be included with the image in the displayed page.
The current situation is not a happy one: some trust the engine (height: auto, width:auto), some trust the CSS (max-width... and/or page-break-inside: avoid), some others make deep calculations (width:63.5%; ) others even insert the image and its caption in a two cells frame, what is sure is that everybody is praying God.
If a svg all-in-one solution could be found, there would be a good chance that the bundle (image + caption) would stay together. That would be a big step forward for humanity.
I tried to fiddle a little with the code. One should maybe add something like that somewhere, maybe by tweaking the viewbox to add a kind of lower stripe?
Code:
<text text-anchor="middle" x="50%" y="40" style="fill:black; font-size:25px; font-family:serif;font-style:italic;">Caption</text>
Could some expert try to find a solution of this kind? Once we have the code, it should not be too complicated to go from one standard svg image to another with caption.
Please find enclosed an EPUB2 test file with two images of very different size (without caption!) to play with.