![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
|
Change font by editing ePub CSS
I just got the nook simple touch, to replace by prematurely deceased 1st-gen nook. With my previous nook, I had created a CSS stylesheet that displayed the text the way I found most comfortable (spacing etc.). I am now attempting to do the same with the new reader.
I want to know how to set the font in the CSS. I have tried changing the "font-family" attribute of different elements, like "body", "p" etc., but nothing seems to effect the text on the reader. All the other attributes are picked up. What do I have to to do to change the font to, say, Amasis or Gill Sans, using the CSS? Since I can't specify the font in the CSS, it's set to "Malabar" when I use Publisher Defaults. One thing I found annoying with the new reader is that the text options are either-or. You can either have the ability to change the settings, like size, font, spacing and margins, or you can enable "Publisher Defaults' for your own CSS tweaks. Turning the latter on and attempting to change any one aspect, like the font, disables the entire CSS information (apart from a few things, like paragraph spacing). With the 1st gen you could have your own CSS and still change any one aspect, with only that aspect being modified. So now I have to specify the font in the CSS too, if I want any tweaks to display a non-Malabar font. Does anyone know how? |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 615
Karma: 575652
Join Date: Oct 2010
Location: Hampton, NH
Device: Kobo Aura H20; Kobo ClaraBW
|
I have mostly done ebooks by taking the original Word document, saving it as HTML in Word, then converting that with Calibre to give me an epub. Then I rweak the epub with Sigil.
When you do that, Calibre puts a lot of code into the epub. At the very beginning (in the first HTML file inside the epub), it puts a ton of font-face items, many which I delete, but I leave ones I want to use. They look like this: @font-face { font-family: Helvetica } @font-face { font-family: Courier New } Then in the css file, it puts entries like this: .MsoBodyText { border-bottom: 0; border-top: 0; display: block; font-family: "Courier New"; font-size: 1em; line-height: 1.1; margin-bottom: 0; margin-left: 0; margin-right: -5.75pt; margin-top: 0; padding-bottom: 0; padding-top: 0; text-align: center } If you then use that css definition in the html for a particular page, it will take effect, as long as you do not override it with the font setting on the Nook - i.e. use Publisher Default. This has worked for me. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
|
I tried using that code, changing the font name to Amasis, but no avail. Also, unless you are using that font name to show how the code should be, Courier New can't work on nook, can it? It's not in the list of default fonts.
|
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 615
Karma: 575652
Join Date: Oct 2010
Location: Hampton, NH
Device: Kobo Aura H20; Kobo ClaraBW
|
There is an interesting article about this here:
http://blog.threepress.org/2009/09/1...in-epub-files/ I notice it says: Every file in your epub must be declared in the OPF manifest. This includes fonts. Put the font in the same place as your OPF file (usually a folder called OEBPS) and add it to the manifest. For example: <item id="epub.embedded.font" href="MyFont.otf" media-type="font/opentype"/> Maybe you need to add this to your code? Sorry, I don't know about whether Courier New works. It's just what I extracted from the code that Calibre puts into the epub it generated. |
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 152
Karma: 216188
Join Date: Jul 2010
Device: Nook Classic, Kobo Touch, Nook Simple Touch, Kobo Aura
|
This works for me.
In Calibre -- Convert Books Look and Feel Select- Filter Style Information Mark all the boxes In the space Other CSS Properties line-height,text-align Now I can usually set the properties I prefer from the device. This works for my wife's STR and my Kobo. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
|
@geormes: does this also work for setting the font? Everything else is working fine, but I am not able to define the font when using 'Publisher Defaults'. I want Amasis, but it only defaults to Malabar.
|
![]() |
![]() |
![]() |
#7 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 152
Karma: 216188
Join Date: Jul 2010
Device: Nook Classic, Kobo Touch, Nook Simple Touch, Kobo Aura
|
ExOblivione
Most of the time when I use this method I am able to select the font I want from my Nook and/or Kobo. I can also change margins, font-size, justification, and spacing. This method does assume a non-DRM epub. If that is what you have and you convert the file this way, Calibre will keep your original file and label it Original_Epub. The converted file will just be epub. |
![]() |
![]() |
![]() |
#8 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45
Karma: 69050
Join Date: Nov 2010
Device: NST, DX, PW1, Voyage, Oasis (1 week), Kobo Aura One (1 week)
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Editing epub's style.css when converting to epub | Pros | Calibre | 0 | 02-02-2012 01:13 PM |
Changing original font css in ePub | jlbfoot | Sony Reader | 4 | 12-28-2010 12:07 PM |
Font fail with Epub CSS | gregcd | Sony Reader | 0 | 10-28-2010 03:45 PM |
epub change font calibre | ploik000 | Calibre | 2 | 08-16-2010 11:34 AM |
Calibre not overwriting ePub CSS font info | jswinden | Calibre | 4 | 04-06-2010 01:29 PM |