01-22-2010, 02:43 AM | #16 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Most of my books are converted from LIT and PDB and the CSS snippet below added into Calibre works beautifully, apart from one book that contained dodgy PML. For me though, one of the most important aspects is overriding the default font to something a bit darker (Georgia or DroidSerif are good choices). In books purchased in ePub format the styles are more diverse and it is hard to work out what to add to the Calibre code - but there is a neat Java applet now that lets me fiddle with the CSS directly for those. Hooray.
For conversions from PDB/LIT I use the following (recklessly plundered from various MR threads) @font-face { font-family: "DroidSerif"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/DroidSerif-Regular.ttf); } @font-face { font-family: "DroidSerif"; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/DroidSerif-Bold.ttf); } @font-face { font-family: "DroidSerif"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/DroidSerif-Italic.ttf); } @font-face { font-family: "DroidSerif"; font-weight: bold; font-style: italic; src: url(res:///Data/fonts/DroidSerif-Bolditalic.ttf); } body { font-family: "DroidSerif", serif; } p { line-height: 130% } div { line-height: 130% } |
01-22-2010, 03:19 AM | #17 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
I am lucky enough to be able to use the PRSplus hack on my PRS-505. This lets me place what fonts I want to use (I use fontin fonts) on my reader and change the font, font size, line height, margins etc on the fly by adjusting my style.css file on the reader. This applies my desired setup to every epub I read, including DRM infected epubs. This applet sounds like an excellent tool for our community. |
|
Advert | |
|
01-22-2010, 03:27 AM | #18 | |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Quote:
The Java tool is described in this thread: https://www.mobileread.com/forums/showthread.php?t=70600 |
|
01-22-2010, 03:33 AM | #19 | ||
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
|
||
01-23-2010, 05:27 PM | #20 |
useR!
Posts: 299
Karma: 651
Join Date: Nov 2007
Location: NY
Device: Onyx Boox Max 2, Kobo Libra H2O, iRiver Story HD
|
It also can be done by using ebook.convert.exe in command-line
Using ebook-convert.exe in command-line may be simpler than using GUI or opening CSS in epub file to modify it by hand. Since I almost never use calibre GUI, I am not sure whether or how this will affect the way GUI handles the database so please bear that in mind. Also, it may be useful only for those who are comfortable with command line.
I made a simple batch file named "2epub.bat" to convert files to epub with the setting I prefer. Code:
REM 2epub.bat ebook-convert %1 "%~n1%~x1.epub" --extra-css="C:\Program Files\calibre\fontin.css" --base-font-size 15 --no-default-epub-cover %2 %3 %4 %5 %6 %7 %8 %9 https://www.mobileread.com/forums/showthread.php?t=36361 Code:
/* CSS for using Fontin fonts*/ /* Note that the Fontin fonts should be located in /fonts/ directory of Sony reader */ /* Modified: 2010 01 15 */ @font-face { font-family: "Fontin"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/Fontin-Regular.ttf); } @font-face { font-family: "Fontin"; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/Fontin-Bold.ttf); } @font-face { font-family: "Fontin"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/Fontin-Italic.ttf); } body { font-family: "Fontin", serif; line-height: 120%; widows: 0; orphans: 0; } Using these files, I can make "filename.ext.epub" from "filename.ext" without overwriting the original file. Code:
2epub "filename.ext" source file name -> output file name will look as follows. -------------------------------------- filename.epub -> filename.epub.epub filename.mobi -> filename.mobi.epub filename.lrf -> filename.lrf.epub This way, if the original source file is epub, the source file is not overwritten. Another reason is that I would like to track what is the source of the final epub file. For example, if I have multiple source files (e.g. freebies from Smashwords), I try converting from epub, mobi, lrf and leave the best one and it helps to know what is the best source file to use. Last edited by soilwork; 03-11-2010 at 08:56 PM. Reason: Typo |
Advert | |
|
02-10-2010, 04:05 PM | #21 |
Connoisseur
Posts: 54
Karma: 38
Join Date: Oct 2009
Location: Waterloo, Canada
Device: Sony PRS-505 (Red)
|
|
02-11-2010, 02:50 AM | #22 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
That is amusing! I did get that title sorted out, and most of the others beaten into submission. The combination of the ePubTweaker.jar and Sigil gets rid of most mischief. The current book "Dragonfly Falling" by Adrian Tchaikovsky was purchased as ePub but had odd Ă characters at each pagebreak, saving it in Sigil sorted that out. Incredible that nobody even opened it in ADE to see that it looked OK before releasing it!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-600 Replace DEFAULT epub fonts! (PRS-600) | pepak | Sony Reader | 33 | 08-04-2023 02:31 PM |
Replace DEFAULT epub fonts! (PRS-505) | pepak | Sony Reader Dev Corner | 70 | 01-22-2011 07:20 PM |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
find and replace, epub | ampsonic | Reading and Management | 3 | 03-02-2010 03:20 AM |
epub, ADE and CSS puzzle | pdurrant | ePub | 3 | 09-03-2009 01:07 PM |