| 
			
			 | 
		#1 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
			
			 
				
				The "best" body?
			 
			
			
			Hi 
		
	
		
		
		
		
		
		
		
		
		
		
		
			I tend to use the same body for each style-sheet of my EPUB2 books. The idea is to include in the body informations that can later be easily modified, if need be, by modern ebook-readers in order to provide more freedom to the reader. This is the one and I would be happy to discuss every point. Code: 
	@page {
  margin-top: 0.4cm;
  margin-bottom: 0.2cm;
}
body {
  margin: 0 0.5cm;
  font-family: "Linux Libertine O";
  line-height: 1.25;
}
1. - Of course, we can use relative units (em or %). Are there any drawbacks? 2. - font-family is named only once 3. - line-height is named only once 4. - lateral margins are set-up only once 5. - I use padding for vertical margins because of some ADE quirks. (replaced with @page following advices) 6. - I use a transparent background-color ... for no particular reason.   (suppressed following advices)7. - font-size is supposed to be 100%, so it's not named here. 8. - Exceptions can still apply for everything: then, new attributes and values have to be added to the relevant styles. Any idea about improving this? Last edited by roger64; 03-24-2014 at 05:29 AM. Reason: Following advices, changed padding witht @page  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I honestly don't see the point in dictating most of those properties in the body. Having to adjust a reader's various overrides (if the reader CAN override all of those settings) each time they open a different ebook from a creator (who each has their own preferences for many of these settings) can get a bit annoying. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I know you embed a font to get around certain characters missing from many readers' system fonts--and I can sympathize with that (although I wish there was a better solution)--but the rest seem really unnecessary to me. The CSS for the body of all my ebooks looks like this: Code: 
	body {
  margin-top: 0;
  margin-right: 3px;
  margin-bottom: 0;
  margin-left: 3px;
  padding: 0;
}
I add an @page to add a bit of top/bottom margin in my personal ebooks just to keep text from getting hidden by the controls on my preferred epub reading software: Code: 
	@page { margin-top: 5pt; margin-bottom: 5pt; }
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks for your comments and your body.  
		
	
		
		
		
		
		
		
		
		
		
		
		
			![]() Thanks for your your warning about long-form notation. I did not know there could be some laggards... I don't use @page (I know calibre does it) because later it conflicts with my PDF-producing software. Were it not for this, its use is very handy. You call "dictate" the fact that I name some atributes. Well, these things (line-height, margins) have to be set-up somewhere anyway, so why not name them sparingly only in the body? I should have said that I also use these values to control my PDF-producing software. Any idea about background-color? Last edited by roger64; 03-22-2014 at 11:09 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | ||
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 Last edited by DiapDealer; 03-22-2014 at 11:20 PM.  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Take line-height. Usually calibre make use of 1.2, sometimes you find it in many many places...  Line-height is quite an important parameter for readability. I use an embedded font with a rather small x-height (like TNR) and so it makes sense to provide the text with a "good" enough (or say matching) line-height. Why should I trust variable "defaults" values on this?  
		
	
		
		
		
		
		
		
		
		
		
		
		
			Furthermore, if you set it up once in the body, any decent software will be able to change it easily. Or am I wrong? When I'm happy or confident with the default, like for the "universal" default font-size (100%), I mark nothing. Quote: 
	
 ![]() Coming back to the choice of the word "dictate". This is a political statement. I would call it "gently recommending" (the same...).  
		Last edited by roger64; 03-23-2014 at 01:23 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Sorry. I don't mean "dictate" in the political sense at all. But for devices/apps that can't override such settings ... it is the correct term.  
		
	
		
		
		
		
		
		
		
		
		
		
	
	 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Sure if they can't.  
		
	
		
		
		
		
		
		
		
		
		
		
		
			![]() And if they can, it's a gentle recommendation. I would dream of a service where one could test the display of his EPUB to sort this out. For me, I have only Calibre, ADE (1.73...), some common Android readers, Azardi and my Kobo Glo (v. 2.8.1. and patched) Also, as I supply PDF with both formats (9x12cm and IPAD), it can sweeten the pill if need be, which really I don't know. Last edited by roger64; 03-23-2014 at 06:43 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Color me gone 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089 
				Karma: 1445295 
				Join Date: Apr 2008 
				Location: Central Oregon Coast 
				
				
				Device: PRS-300 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Having an old Sony PRS-300, I can't override anything, so setting text sizes and so on can make for too big or too small on my small screen. Of course if you have to embed a font that is too stubby then you have to fix it. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I almost never embed a font, but then my work is all in English. My current one has romaji words in it, so I needed the long o which Charis provides.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 frumious Bandersnatch 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,570 
				Karma: 20150435 
				Join Date: Jan 2008 
				Location: Spaniard in Sweden 
				
				
				Device: Cybook Orizon, Kobo Aura 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			My "body" is much simpler: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	body { margin: 0; } @page { margin: 2mm; } (or the equivalent with long-style properties) If I want to override @page settings when converting to pdf, I can easily do that using "!important". Line-height is extremely dependent on the font, I never set it (except to prevent increase line separation in superscripts or drop caps).  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			@Jellby 
		
	
		
		
		
		
		
		
		
		
		
		
		
			I know you like the minimalist approach. ![]() Line-height or no line-height? It's a yes or no question. You let the user rely on its system fonts. And, since you do not embed a font and do not know which font the user will select, it seems better for you not to setup a line-height. This is a fairly logical no-no answer. But the opposite seems logical too. Since I embed a font, I also setup a matching line-height. It's just a yes-yes answer. It seems that each choice entails the same questions. For my choice (yes to line-height), the main question is to know if these settings which are setup once in the body have to be considered as hard-coded ("dictated") or can be easily modified ("gently recommended"). If I judge from my -modern- e-reader, I can still change easily the font, modify the line-height and the margins though they are set-up in the body. Nothing has been "dictated". But, I have been told that maybe this is a controversial point of view (owners of old machines can really setup nothing). For your choice (no to line-height), at least not in the body, let's consider what can be the consequences: - You probably would not setup the line-height for each style in the CSS. It would be the worst choice because now no e-reader would be able to modify anything. And the user would have to dig in the CSS... So what's left? - Either you let the e-reader/app settings choose for the user. I am not aware that these machines or apps are smart enough so as to adapt the line-height according to the x-height of the selected font. Is it a better choice? Furthermore, machine or apps default settings can differ since there is no standard on this field. I know Calibre defaults frequently to 1.2 which seems to go well with Georgia kind of fonts. Which one will be the right one? Do you leave it to luck? - Or you probably consider that the user will always be able to modify the line-height setting. I bring you back then to the DiapDealer argument expressed above: even the owners of old machines? We make different choices but it seems that the questions arisen are not that different... The use of @page @page is a very handy way to control vertical margins. So, thank you for your information. I will try to modify your scripts with important! and maybe contact you if I fail...  
		Last edited by roger64; 03-24-2014 at 11:47 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 ![]() So, I edited the first post and replaced the padding attributes with @page. I also suppressed the background-color attribute. Last edited by roger64; 03-24-2014 at 05:30 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520 
				Karma: 121692313 
				Join Date: Oct 2009 
				Location: Heemskerk, NL 
				
				
				Device: PRS-T1, Kobo Touch, Kobo Aura 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Be aware that font family in the body will be ignored by a Nook. I do not know if also font-family like serif will be ignored though.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Fanatic 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 541 
				Karma: 1152752 
				Join Date: Aug 2010 
				Location: Evansville, IN, USA 
				
				
				Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Only if you have publisher defaults turned off, unless you're talking about Nook eink readers and there's a difference between the Nook eink and tablet readers. My Nook Tablet and Nook HD+ have no problems picking up and using font-family as defined in the body.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,625 
				Karma: 3120635 
				Join Date: Jan 2009 
				
				
				
				Device: Kindle PW3 (wifi) 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 ![]() But maybe there is some hope or recent change in this field following bfollowell informations? I try to follow ADE which has already lots of limitations (for example the first element would not work). Other players have others. Kobo is very touchy about some font-naming conventions for embedded fonts. Hopefully they'll go mainstream... one day. Last edited by roger64; 03-24-2014 at 12:08 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#15 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| "Versteckte Bilder" oder "Was man mit ebooks nicht machen kann." | beachwanderer | Lounge | 1 | 01-15-2014 08:41 AM | 
| Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" | therealjoeblow | Calibre | 15 | 07-25-2011 04:14 PM | 
| <body style=""> How to stop this? | Danger | Sigil | 8 | 12-13-2010 09:17 PM |