01-25-2012, 01:02 PM | #76 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
then if you view at the zoom-level which is set to 100 in <fontSizeTableEpub> all 4 paragraphs look the same. As expected, as you change zoom levels, the first 3 zoom accordingly but the last stays the same. So for epub, I'd say the units are equivalent to %s, i.e. a setting of 80 in the table will be equivalent to font-size 80% or 0.8em in the css. Last edited by jackie_w; 01-25-2012 at 01:39 PM. |
|
01-26-2012, 05:31 AM | #77 |
Enthusiast
Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
jackie_w
Thank you for your datailed answer! Morkl After installing your modified EbookReader, some of my epubs couldn't be opened any more. I compared these epubs to those which work and found out that the *.opf and *.ncx files in the 'bad' epubs were saved as UTF-8 without BOM and using Unix line break style (LF only) and in the 'good' epubs - as UTF-8 with BOM and using Windows line break style (CR+LF). I re-saved the *.opf and *.ncx files of one 'bad' epub using the "right' format, and it could be opened well again. This is not really a bug, but maybe it would be possible for you to fix them... |
01-27-2012, 07:37 AM | #78 | ||||
Connoisseur
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
|
Quote:
Quote:
Did the files work in the stock Reader (that would be strange, since I haven't touched anything that should affect that functionality)? Anyhow, I'll take a look at it when I have the time. Do you have font-variant: small-caps definitions that work on the PRS-T1? Care to share? Quote:
Quote:
So, something like this: Code:
<style name="MyFont" basestyle="style.css" serifregular="reg.ttf" serifitalic="italic.ttf" serifbold="bold.ttf" serifbolditalic="bolditalic.ttf" sansregular="sansreg.ttf" sansitalic="sansitalic.ttf" sansbold="sansbold.ttf" sansbolditalic="sansbolditalic.ttf" /> Code:
<styles baseStyle="base.css"> <style name="Modern" style="modern.css" /> <style name="Fantasy" style="fantasy.css" /> <style name="Extra Margins" style="extramargins.css" /> <!-- ... --> </styles> CSS selector integrated in the Reader that remembers the setting for each book Very easy to implement Cons: CSS files need to be kept for each style So, which way do you think would be the best? |
||||
01-27-2012, 10:18 AM | #79 | |||
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
My main aim was to correctly display SmallCaps in epubs created from my own HTML/CSS files which are written like Code:
HTML file: <p>...<span class="smallcaps">this text displays in SmallCaps</span>...</p> CSS file: .smallcaps {font-variant: small-caps} Code:
@font-face {font-family: "SCfont"; font-weight: normal; font-style: normal; src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/xxx.ttf)} @font-face {font-family: "SCfont"; font-weight: normal; font-style: italic; src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/xxx-Italic.ttf)} @font-face {font-family: "SCfont"; font-weight: bold; font-style: normal; src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/xxx-Bold.ttf)} @font-face {font-family: "SCfont"; font-weight: bold; font-style: italic; src: url(res:///ebook/fonts/../../mnt/sdcard/reader/fonts/xxx-BoldItalic.ttf)} .smallcaps {font-family: "SCfont", serif; font-variant: normal} The crude solution above should still work to use the specified SmallCaps font but the biggest problem is that they rarely use an obvious descriptive name like smallcaps as the css selector name. I've settled on the following in my style.css Code:
.smallcaps, .smallcaps1, .smallcaps2, .small-caps, .sc, .fsc, .smallCaps, .Smallcaps, .SmallCaps { font-family: "SCfont", serif; font-variant: normal} Quote:
Quote:
Not much of a Con for PRS+ users. We've always done it this way. Creating your first CSS file is the hardest. It's mainly copy/paste with minor tweaks for the rest. |
|||
01-27-2012, 10:50 AM | #80 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
They eventually tracked the problem down to the DRM-stripping tool they were using. |
|
01-27-2012, 03:06 PM | #81 | |
Connoisseur
Posts: 62
Karma: 36180
Join Date: Dec 2011
Location: US East Coast
Device: Kobo Aura HD, Kindle 4, Sony PRS-T1 (formerly PRS-500 & 505), iPad Air
|
Quote:
By the way, on the font selector screen, can you remove the warning message at the bottom and increase the number of selector items? Once the warning's gone, maybe you can fit one or two more. |
|
01-28-2012, 05:14 AM | #82 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2008
Location: London
Device: Kobo GloHD and Aura h2O
|
After installing the modified Reader (replacing the stock) my epubs displayed huge fonts - even the smallest was too large.
I edited the xml as below which gives the sizes I want. My query is why the default setting is so huge on my Reader - is there some other setting I missed? <fontSizeTableEpub> <int>28</int> <int>36</int> <int>44</int> <int>52</int> <int>60</int> <int>68</int> <int>76</int> <int>84</int> </fontSizeTableEpub> |
01-28-2012, 05:15 AM | #83 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2008
Location: London
Device: Kobo GloHD and Aura h2O
|
Re my last post - it shows me as owning a Sony 505 - I do but am now using the PRS-T1
|
01-28-2012, 05:54 AM | #84 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
I set all my epubs to have main body text at font-size:1em and my <fontSizeTableEpub> values range from 75-110 in increments of 5. I haven't had any problems so far. [Edit:] ... just another thought, there may also be an effect created by which custom font(s) you've set up. Some fonts display bigger than others e.g. 2 of my custom fonts are Kindle Caecilia and Arno Pro. The former looks 'best', to me, at zoom level 2 (80) the latter at zoom level 7 (105) Last edited by jackie_w; 01-28-2012 at 05:59 AM. |
|
01-28-2012, 09:25 AM | #85 | |
Connoisseur
Posts: 62
Karma: 36180
Join Date: Dec 2011
Location: US East Coast
Device: Kobo Aura HD, Kindle 4, Sony PRS-T1 (formerly PRS-500 & 505), iPad Air
|
Quote:
|
|
01-28-2012, 09:57 AM | #86 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Aug 2008
Location: London
Device: Kobo GloHD and Aura h2O
|
|
01-29-2012, 11:56 AM | #87 | |
Connoisseur
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
|
Quote:
The selector can handle more items; I just have to make sure it's not too easy to break things, e.g. by selecting the last item in the list and then reducing the number of available items or going back to the stock Reader. My bad; should have left a note about it in the readme. I set the large size as default style.css as an indicator to show that the custom CSS is being used. |
|
01-30-2012, 05:58 AM | #88 | |
Enthusiast
Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
Quote:
The modified EbookReader aborts openning an epub with the error 'Invalid page', if the font for that epub is set to another than 'Original' and there is no section <fonts> in the reader.xml (I commented it out to get SONYs original fonts set). If the section <fonts> is present, everything works well! |
|
01-30-2012, 11:15 AM | #89 | |
Connoisseur
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
|
Quote:
|
|
02-25-2012, 09:21 PM | #90 |
Enthusiast
Posts: 37
Karma: 16
Join Date: Nov 2011
Device: Sony PRS-T1
|
Thanks for your excellent work, Morkl.
Is there any chance EbookReader could be modified further to correctly display right-to-left Hebrew texts? |
Tags |
css, fonts |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-350 Changing Fonts in PRS+ | spacebrew | Sony Reader Dev Corner | 31 | 08-24-2012 06:29 AM |
PRS-350 PRS 350 & PRS+: Changing LRF-fonts permanently | Analogus | Sony Reader Dev Corner | 21 | 11-08-2011 11:55 AM |
Am i doing it right?PRS+ and CSS forced Epub fonts via Calibre | melkorbauglir | Sony Reader | 20 | 07-29-2011 10:09 AM |
How does the fonts of PRS-350 and PRS-650 compare to each other? | lkkmaths | Sony Reader | 16 | 04-08-2011 07:43 PM |
Changing text size and fonts with PRS 505 | levi_john | Sony Reader | 1 | 01-20-2009 03:25 AM |