![]() |
#16 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Code:
.portrait { height: 100vh; } ![]() |
|
![]() |
![]() |
![]() |
#17 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
1. In the .xhtml file: Code:
<figure> <svg style="height: 90vh; width: 100vh" xmlns="http://www.w3.org/2000/svg" height="90%" preserveAspectRatio="xMidYMid meet" version="1.1" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="100%" width="100%" xlink:href="../Images/C1.jpg"/></svg> <figcaption>Insert your caption here</figcaption> </figure> Code:
body { margin: 0; padding: 0; } svg { width: auto; max-width: 100%; height: auto; } figure { margin: 0; /*important*/ text-indent: 0; text-align: center; display: block; /*very very important*/ line-height: 0px; /*some way important*/ } figcaption { font-size: 16px; line-height: 20px; text-indent: 0; display: block; /*very very important*/ } Quote:
![]() Quote:
Regards Rubén Last edited by RbnJrg; 01-29-2019 at 02:46 PM. |
|||
![]() |
![]() |
![]() |
#18 | |
Annabelle Viau
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
|
Quote:
Aaah you found it! I was actually using @supports to apply the 100vh on that div, which ADE doesn’t support on ePub3, hence the problem. Great, my mind is at peace :-) And nice work on finding the Blitz code affecting my code! I was thinking to do it today but you saved me from some extra work. ![]() I have to say again that Jiminy Panoz did say that using <img> inside a <svg> tag can be deadly as some resellers automatically reformat the code. And even Apple discourage that uses... So I guess it’s a "use at your own risk" kind of code. ![]() |
|
![]() |
![]() |
![]() |
#19 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi Ruben
Thanks to both of you for working so hard for cracking this old -but strong- nut. I tried both test ePubs. The ePub3 and 2 display nicely with Calibre and Sigil as you know. But ePubcheck complains about the ePub2 version and flags some errors or warnings. Prince, which is usually quite good for displaying ePubs, seems to ignore this code. As this is an experimental code (correct but not widely used), could it be useful to add a fall back alternative display? |
![]() |
![]() |
![]() |
#20 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
It's perfectly secure to employ the tag <image> (not <img>) inside a svg wrapper. What is not secure is to employ the "vh" measure unit. I tested the epubs in my previous post and they works fine under Sigil, Calibre, ADE, Readium and Azardi. The only drawback is that the caption not always remains with the picture. I had to force a bit the things to get that. As you can see, I used px as measure unit in the caption. Of that way the text doesn't resize and always is displayed together with the image.
|
![]() |
![]() |
![]() |
#21 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Indeed, under epub2 there are some code not supported by the protocol. The tags <figure>, <figcaption> and the measure unit "vh" are not from epub2. So, under that protocol some ereaders can have issues. But in ADE things are displayed well. The main problem under epub2 is the caption; I'll do some experiments to see if I can find something to avoid any trouble (but the most important is the code to show an image; no size at all, just percentage so no matter the size of the picture, the code will be the same). |
|
![]() |
![]() |
![]() |
#22 | ||
Annabelle Viau
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#23 | |
Annabelle Viau
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
|
Quote:
|
|
![]() |
![]() |
![]() |
#24 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
https://www.princexml.com/ Free for personal use. Usually excellent for converting ePub2 or 3 to PDF using Calibre (see above) or Sigil plugin. Edit: using Ruben's code, Prince 12.4 displays only the caption. (in good place) Last edited by roger64; 01-30-2019 at 09:57 AM. |
|
![]() |
![]() |
![]() |
#25 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,026
Karma: 90000009
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
I tried the EPUBs in post #17 in Amazon's Kindle Previewer to see how they would look. Both performed the same.
The image was displayed (large within the page margins) on one page and the caption by itself at the bottom of the next page. Conversion for Enhanced Typesetting failed due to code that does not meet the Amazon Kindle Publishing Guidelines, meaning that a book published with that code would be missing many of the newer Kindle reading features. |
![]() |
![]() |
![]() |
#26 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#27 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
What resellers Momoha? Any name? Because svg and svg wrappers have been being used for years, is not something new. The only issue with your code is the caption that not always will be together with the picture. I can handle that. But the image is well displayed and that is the important.
|
![]() |
![]() |
![]() |
#28 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,026
Karma: 90000009
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
That is not completely true. It is true that some SVG features are supported in KF8, but not KFX. But KFX (Enhanced Typesetting) does support a subset of SVG, including the commonly used SVG image wrapper code.
|
![]() |
![]() |
![]() |
#29 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Do you thing so? Well, please, tell me why the epub I attach where I employ a "standart" svg wrapper with a image and simple text inside is not supported by KFX? The text inside the svg wrapper is a way to have a perfect caption, so no matter the font-size choosen by the reader, the caption will remain with the picture. A very very common svg wrapper. If KFX can't support this (svg text), then practically can't support anything about svg.
|
![]() |
![]() |
![]() |
#30 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,026
Karma: 90000009
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
It is true, KFX does not support SVG text. I don't know of a surefire way to have captions that will display with the user's selected font and always be displayed on the same page as an image. My point is that there is no single best option. There is a tradeoff that a Kindle ebook publisher will need to make between using the full capabilities of SVG and having the features of KFX available to the reader. Last edited by jhowell; 01-30-2019 at 04:37 PM. Reason: typo |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Novels set in revolutionary Russia? | seagull | Reading Recommendations | 15 | 03-18-2013 09:40 AM |
Revolutionary writing | amalfiman | General Discussions | 2 | 07-16-2010 10:28 PM |
Publishing: The Revolutionary Future | Pardoz | News | 35 | 02-23-2010 08:51 PM |
A revolutionary decade | Argel | News | 1 | 05-26-2008 07:42 AM |