06-14-2014, 06:32 AM | #16 | |||||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
SVG works in KF8, and shows up as a blank in the old MOBI format "KF7" (Kindle 1+2+DX). You need a JPG/GIF/PNG fallback. Since you are going to create the JPG/GIF/PNG anyway, most publishers/converters just settle on the easiest + least labor intensive + least headache method... which "works" across all devices (although as you noticed, if an image of a table gets scaled up/down, the text starts looking like junk). Quote:
Side Note: Fantastic work by the way, this is DEFINITELY better than a bunch of the crap that I get. SVG/Vector Graphs are a HUGE PLUS (you would be surprised how much JPG trash I have to work through... and then the source document gets lost in the abyss, and you have no way of generating a higher resolution image.... Makes me want to pull my hair out).) Quote:
I opened up the SVG in a text editor, and spotted this: Quote:
I did a Replace All and replaced everything in RED with what DaleDe mentioned above: Quote:
Before: After: When using any non-Calibri fonts, letters ran into eachother (seen in the After picture above). I wittled the error down to the part marked in BLUE (I think this is specifying an exact location of each letter along the x-axis?): Quote:
The EPUB includes:
Anyway, I had a giant tome written tackling a lot of your statements/questions + a ton of screenshots... but it will take me a while to go through and edit it (and I am too tired currently). I will maybe post it tomorrow/in a few days tackling/discussing a few more of the things that were brought up. Last edited by Tex2002ans; 06-14-2014 at 06:53 AM. |
|||||||
06-14-2014, 09:51 AM | #17 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
1) Use the font of your election in Inkscape and, before saving the file, convert all the svg graph to "paths"; or 2) On the other hand, if you don't want to convert the font to paths, you have to embed it in the ebook where you are going to use that font. But before using it, you have to declare it in the svg graph by using: Code:
<defs> <style type="text/css"> <![CDATA[ @font-face { font-family: "MyFont"; /* Of course this name can vary */ src: url("../Fonts/MyFont.ttf"); /* And here you'll write the font of your election */ } ]]> </style> </defs> Code:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="155" height="120"> <defs> <style type="text/css"> <![CDATA[ @font-face { font-family: "Marnie"; src: url("../Fonts/Marnie.ttf"); } ]]> </style> </defs> <text x="77.5" y="117" style="font-size: 150px; font-weight: bold" font-family="Marnie" text-anchor="middle">T</text> </svg> Regards Rubén NOTE: Sigil doesn't show the svg embeded fonts (a Sigil bug evidently) but if you open the ePub in ADE, you'll perfectly see your custom font in your svg graph. Last edited by RbnJrg; 06-14-2014 at 04:56 PM. |
|
Advert | |
|
06-14-2014, 10:54 AM | #18 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Code:
<text x="250" y="150" font-family="sans-serif" font-size="55" fill="blue" > Hello, out there </text> Last edited by DaleDe; 06-14-2014 at 11:07 AM. |
|
06-14-2014, 11:27 AM | #19 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
|
I though I had it but I had opened an old file that had the PNGs rather than the SVGs. So no good news after all.
(I couldn't figure out how to delete my earlier post, so I just edited it.) Last edited by MikeWV; 06-14-2014 at 11:37 AM. Reason: Delete Earlier Post |
06-14-2014, 11:52 AM | #20 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
|
Font Familiy in SVG File
Yes, Dale, the font family is specified in the SVG file for every text element in the file. I opened couple of the SVGs with Notepad++ and looked for a means of specifying the font family universally or forcing the SVG font specification to override the browser/reader default font but struck out.
According to what I read earlier today, applying "font-family: sans-serif" to the parent element should set the font for the SVG. But as I said earlier, it's not working. The parent element is an inline block specified by a CSS class. I tried adding the style to the class but it had no effect. And I tried adding it to the class of the division the inline block is in and within the image tag but neither of them worked either. I'm going to post my XHTML code and associated CSS for my images. Maybe someone will see something I'm overlooking. |
Advert | |
|
06-14-2014, 12:03 PM | #21 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
|
SVG Image Code
The following is an example of the code I'm using for my images. Maybe someone will see a reason why applying "font-family: sans-serif" to the parent element is having no effect.
<div class="txcenter"> <p class="imcenter"> <img src="../images/13f01_eff_front_graph.svg" width="100%" height="auto" alt="Efficient Frontier Plot" title="Efficient Frontier Plot" /> </p> <p class="figurenum">Figure 13-1</p> </div> img { display: block; text-indent: 0; margin-left: auto; margin-right: auto; margin-bottom: 0; } .txcenter { text-align: center; page-break-inside: avoid; } .imcenter { text-align: center; display:inline-block; font-family: sans-serif; This has no effect. } Any place where font-family has been specified in the CSS it has been specified as normal. I did that so that readers can use their preferred fonts. .txcenter is the class for the division that contains the inline block. Adding font-family to that class has no effect either. |
06-14-2014, 01:01 PM | #22 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
06-14-2014, 01:48 PM | #23 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
|
Tex2002ans,
When I refreshed the page this morning, your post was above where I landed after punching F5 and I just now found your post. It will take me a while to digest all of that and see what you did in the attached file. I appreciate the time and effort you've expended on this issue. Mike |
06-14-2014, 10:54 PM | #24 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
There is a serious bug with the SVG tables. If they are too long for the page, they run over to the next page and if they are still too long, you don't see all the rows.
The HTML table splits at whatever rows don't fit and moves them to the next page properly. My suggestion is to forget SVG and stick with HTML for tables. |
06-15-2014, 01:16 AM | #25 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
No problem. SVG has been an area I have been quite interested in, but haven't spent as much time as I would like.
It is definitely an area that isn't well documented/tested in the ebook field. RbnJrg has definitely fiddled around with it much more than most of us on the boards. Last edited by Tex2002ans; 06-15-2014 at 01:51 AM. |
06-15-2014, 09:51 AM | #26 |
Connoisseur
Posts: 54
Karma: 10
Join Date: Nov 2013
Device: Kobo Touch
|
SVG Table Overflow Bug
That's not good but's it's good to know. I though the problem was either attributable to my coding or some idiosyncrasy of my Kobo.
|
06-15-2014, 02:19 PM | #27 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Code:
width="577.20001" height="789.90002" If your device does not have enough pixels for that width/height, the image can flow off the edges of the device (just like your typical too large image, that isn't resized via CSS). I attached a new EPUB with the typical "Cover" SVG Wrapper that many use. I wrapped it around the table + tweaked the width/height, so now it should resize to fill the entire width/height of the device, while maintaining a proper ratio. (Tested it on my Nook, it works perfect). Quote:
Side Note: A lot of this talk got me thinking about my SVG Tutorial I had laid the groundwork on... I looked in my notes, and I haven't touched it since February. I should get back on doing thorough research/testing/writing. Last edited by Tex2002ans; 06-15-2014 at 02:23 PM. |
||
06-15-2014, 05:20 PM | #28 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
After viewing the new test ePub from tex2002ans, I issues with both SVG and HTMLbtables.
I made the size of my ADE window smaller. The SVG table in the SVG wrapper did work as expected, but because it fit the entire table on screen at once, it was too small to read. The HTML table was good to read until I increased the font size to be too large to fit width wise without going past the edge of the window. But if the font size was not too large, it displayed best because it was more readable and the rows that didn't fit dropped to the next page (and so on). So in either case, there are issues. If it's a small enough and simple enough table, SVG could work. HTML could work as well. The font size did not change with the SVG table in the SVG wrapper. I could change the font size with the HTML table. Given that you don;t know the font size nor the screen size, the HTML table is a better option. Especially when reading on a cell phone screen such as an iPhone. As for a 6" eInk screen, I would say again, the HTML table is better. given how many rows are in the SVG table, it would come out smaller and harder for to read. The HTML table as long as the font size is not too large to go off the side of the screen, it's the winner. |
06-15-2014, 09:43 PM | #29 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
And while you would HOPE that your readers would choose a more suitable device for non-fiction, technical works (tablets, PCs, etc. etc.), you can't guarantee that... Potential pro for bitmap image: Now, depending on your device, SOME of them allow you to click on a JPG/GIF/PNG, and get a full-scale version of the image, which you can then scroll around. This might be a case where a large table might MIGHT beat out a comparable SVG. I do not believe these devices can allow you to do the same thing via SVG (expand + scroll). Pro for SVG: On devices that do not have such capabilities, the legibility of the text in the SVG image would DESTROY the shrunken JPG/GIF/PNG (image resizing algorithms on typically do HORRENDOUSLY on text). Quote:
For that specific table, there was the "Weights" spanning 4 columns + the "Portfolio Number"... it would be QUITE odd having Portfolio Number + 3 of the 4 "Weight"s. And then the 2nd Table with "Portofolio Number" + 1 "Weight" + the rest of the data. This again goes back to the pro/con balancing scale... Coming up with the best way to transfer a table to be readable on a smaller device.... sometimes it is just not possible to logically split the data while maintaining comprehension. Side Note: And here we come back to the balancing scale. Most just settle on making a bitmap image of the table, and screw the disadvantages, it works "good enough" It takes about two seconds to generate an image (and IS compatible with nearly every device).... but it takes a lot more hard work trying to make books more accessible/user/reader friendly! Quote:
is better than this: (Notice the SVG text is specified as black... Black on black, no good!). and here is a screenshot of the 96dpi image of the table: This is an example of the disadvantage of going the image route... while it looks fine on white background + black text, it begins to fall apart when the user decides to use anything else as their background colors. And sure, sure, the HTML table I made isn't as pretty... but it follows user preferences. The HTML table can change font size/color, and scale to quite a large font size on the same size screen (comparable to the image/SVG). Also, your book will become much more accessible to a person with poor eyesight (this is one of the FANTASTIC advantages of ebooks compared to their (crappy) physical counterparts!). Quote:
Last edited by Tex2002ans; 06-15-2014 at 09:48 PM. |
||||
06-15-2014, 10:00 PM | #30 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I'd still stick with the HTML. Try it on an iPhone with Bluefire and if it works well enough, go for it. But don't forget to try larger font sizes until it breaks to see if you can go large enough. I mean one thing the reader can do is when the reader gets to the table, reduce the font size for the table. Then increase again for the rest of the book.
|
Tags |
charts, images, svg, tables |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A problem with images inside tables | RbnJrg | ePub | 2 | 10-28-2013 09:09 PM |
can I use SVG images in mobi? | sarah_pnix | Kindle Formats | 4 | 01-07-2013 04:21 PM |
Q: Tables, images, and word-wrap | AndrewH | Workshop | 2 | 12-22-2010 02:34 AM |
PDF conversion which respects images/tables? | fivebells | Amazon Kindle | 9 | 12-19-2010 11:18 AM |
tables or svg? | bobcdy | ePub | 18 | 12-06-2010 02:24 PM |