Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-26-2017, 02:40 PM   #1
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
Is there really a need to specify a font-family?

I exported a book to epub from inDesign with a handful of fonts. I'm not sure I need embedded fonts so I eliminated all of the @font-face css and now all styles are simply set to font-family: serif or font-family: sans-serif and it seems to work. When I open the book in iBooks or Kindle every font face inherits the font selected by the reader and ignores the serif/sans-serif distinction but it acted this way before I eliminated the @font-face css. Here are some basic questions. (I am editing with calibre.)
*
1. If the device defaults to the font selected by the reader (serif or sans-serif) regardless of the specified font-family in the css rule, do I even need to include a font-family for any of the css rules?
*
2. I don't want to embed fonts but if I do specify font families used by a device (Georgia and Helvetica for instance) should the device honor the rule? In other words, if the css for chapter and subchapter headings is san-serif and the remainder of the text is serif, will they display that way? I ask because before I removed the specific font families, all fonts faces defaulted to the one selected by the reader and, in most instances, ignored the serif and sans-serif distinction. I tested it in iBooks with one simple page of text with a sans-serif heading (Ariel) and serif (Georgia) text and it still ignored the serif/sans-serif distinction.
spamis is offline   Reply With Quote
Old 02-26-2017, 03:12 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,896
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
font-family: serif is not needed as it is the default. That can go. It can cause a problem with some software being unable to change the font.

font-family: sans-serif is needed to change the font. As long as i is not used for the main body font then leave it as is.
JSWolf is offline   Reply With Quote
Old 02-26-2017, 03:49 PM   #3
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
Thank you for your quick response. Maybe you could answer another for me. Before your response, all text in my epub, whether it was serif or sans-serif, defaulted to the font selected by the reader. In a test epub file, I deleted font-family: serif and kept font-family:sans-serif as you recommended and in iBooks the headline and body text follow the css rule assigned to them regardless of the font the device is set to. In other words the headlines remain sans-serif even if the reader is set to a serif font. However, in the same sample file in Kindle (Mac OS X version) the headline font does not behave. If the reader’s font is a serif (Georgia for instance) the headline font that’s supposed to display as sans-serif defaults to Georgia. Is this a Kindle quirk? Is there a uniform way I can force devices to stick with the sans-serif for a headline even if the reader selects a serif font?
spamis is offline   Reply With Quote
Old 02-26-2017, 04:15 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,896
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It could be a quark of iBooks. if you use a heading tag such as <h2> then iBooks could be assigning a sans-serif font. The thing to do is load the ePub is Calibre and use the scramble eBook plugin and then post the scrambled eBook so I can have a look at it and you can tell me what it should be doing that it is not.
JSWolf is offline   Reply With Quote
Old 02-26-2017, 04:46 PM   #5
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
Here it is

Book is 120 pages long so for now i'm working out some bugs with one file. I assume the file is attached.
Attached Files
File Type: epub ListTest2.epub (228.6 KB, 260 views)
spamis is offline   Reply With Quote
Old 02-26-2017, 05:13 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,896
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by spamis View Post
Book is 120 pages long so for now i'm working out some bugs with one file. I assume the file is attached.
The header is sans-serif. But, the header is also in a color. Do you mean it to not be black?
JSWolf is offline   Reply With Quote
Old 02-26-2017, 05:58 PM   #7
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
Yes, I mean for it to be that color. Like I said, if I pull this file into iBooks and look at it on iPad, iPhone, or my laptop, the purple heading retains the sans-serif formatting regardless of which device font I choose. In Kindle, the sans-serif is ignored. It's probably not that big of a deal but I was just wondering if there is a way to insure that the sans-serif stays that way even if the reader chooses a serif font.
spamis is offline   Reply With Quote
Old 02-26-2017, 11:29 PM   #8
SigilBear
Banned
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Quote:
Originally Posted by spamis View Post
It's probably not that big of a deal but I was just wondering if there is a way to insure that the sans-serif stays that way even if the reader chooses a serif font.
Interesting. I noticed a similar thing in iBook (though I haven't checked it in Kindle). Certain elements that are styled to display in sans serif still display in serif. In the case of headings, I wonder if you could just use inline styles...
SigilBear is offline   Reply With Quote
Old 02-27-2017, 11:37 AM   #9
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
I can't quite give up on this yet. Sans-serif is honored in iBooks but not in Kindle.

I started with <p class="caption"> Caption</p> and font-family set to sans-serif. No go. I next changed p.caption to h1 giving me <h1>Caption</h1> with the font-family still set to sans-serif. Nothing. I then changed from simple font-family: sans-serif to font-family: Helvetica, sans-serif. Nada. I tried SigilBear's suggestion by removing the font-family from h1 and tried with this: <h1><span style="font-family: Helvetica, sans-serif">Caption</span></h1> and that didn't work. As I said earlier, I can live with this quirk but I am still looking for an answer (if there is one) in case I ever do have to have the caption or some other text be sans-serif regardless of the font selected by the reader. Any additional thoughts will be appreciated.
spamis is offline   Reply With Quote
Old 02-27-2017, 02:42 PM   #10
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
Quote:
Originally Posted by spamis View Post
... I am still looking for an answer (if there is one) in case I ever do have to have the caption or some other text be sans-serif regardless of the font selected by the reader. Any additional thoughts will be appreciated.
No, you can't force any reading app to do anything, period. All you can do it "ask politely", but if the reading app refuses to comply to your request the only thing you can do that might solve the issue is to poke around in the reader's preferences to see if there is an option that might help or to change to a different reading app.

Last edited by Jellby; 02-28-2017 at 12:45 PM.
dwig is offline   Reply With Quote
Old 02-28-2017, 06:40 AM   #11
spamis
Junior Member
spamis began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2017
Device: none
Thanks for all the advise. Dwig's response is what I thought but after many hours I was unable to find a definitive answer.
spamis is offline   Reply With Quote
Old 03-01-2017, 06:38 AM   #12
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by dwig View Post
No, you can't force any reading app to do anything, period. All you can do it "ask politely", but if the reading app refuses to comply to your request the only thing you can do that might solve the issue is to poke around in the reader's preferences to see if there is an option that might help or to change to a different reading app.
Nicely said!

My rule is this: let the defaults rule! I have pretty firm opinions on how a book should look, but I save them for the print edition. I have a few trick paragraphs, but I seldom use them any longer. My style sheet is posted at http://notjohnkdp.blogspot.com/2013/...yle-sheet.html
Notjohn is offline   Reply With Quote
Reply

Tags
epub, font-family


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to embedd/use medium typeface from a font family Hobb Calibre 3 06-26-2015 03:18 AM
CSS: font-family fallbacks ElMiko Sigil 4 02-08-2012 03:43 PM
Changing Font Family thymaster Sony Reader 6 09-19-2010 01:10 AM
Basic CSS Font family question! kjk ePub 2 05-27-2010 01:28 PM
Font Family should help Contrast jbruce Sony Reader 31 04-17-2009 12:43 AM


All times are GMT -4. The time now is 12:04 PM.


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