Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Barnes & Noble NOOK

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2012, 03:40 AM   #1
ExOblivione
Junior Member
ExOblivione began at the beginning.
 
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?
ExOblivione is offline   Reply With Quote
Old 03-08-2012, 08:13 AM   #2
RAH
Fanatic
RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.
 
Posts: 576
Karma: 575652
Join Date: Oct 2010
Location: Hampton, NH
Device: Color Nook; Nook Touch
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.
RAH is offline   Reply With Quote
Old 03-08-2012, 11:07 AM   #3
ExOblivione
Junior Member
ExOblivione began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
Quote:
Originally Posted by RAH View Post
...

@font-face {
font-family: Courier New
}
...
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.
ExOblivione is offline   Reply With Quote
Old 03-09-2012, 07:37 AM   #4
RAH
Fanatic
RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.
 
Posts: 576
Karma: 575652
Join Date: Oct 2010
Location: Hampton, NH
Device: Color Nook; Nook Touch
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.
RAH is offline   Reply With Quote
Old 03-10-2012, 09:27 AM   #5
geormes
Zealot
geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.
 
geormes's Avatar
 
Posts: 147
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.
geormes is offline   Reply With Quote
Old 03-11-2012, 03:08 PM   #6
ExOblivione
Junior Member
ExOblivione began at the beginning.
 
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.
ExOblivione is offline   Reply With Quote
Old 03-12-2012, 06:22 AM   #7
geormes
Zealot
geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.geormes ought to be getting tired of karma fortunes by now.
 
geormes's Avatar
 
Posts: 147
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.
geormes is offline   Reply With Quote
Old 03-12-2012, 11:22 AM   #8
ExOblivione
Junior Member
ExOblivione began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2012
Device: nook ST
Quote:
Originally Posted by geormes View Post
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.
Hey! That worked! Even better than what I wanted!
ExOblivione is offline   Reply With Quote
Old 12-25-2012, 12:48 AM   #9
bokolobs
Enthusiast
bokolobs began at the beginning.
 
bokolobs's Avatar
 
Posts: 34
Karma: 10
Join Date: Nov 2010
Device: Nook Simple Touch, Kindle DX, Kindle Paperwhite
Quote:
Originally Posted by geormes View Post
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.
I've been looking a looooong time for this. Thank you very much for the info!
bokolobs is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:48 PM.


MobileRead.com is a privately owned, operated and funded community.