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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2009, 04:53 AM   #31
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by radius View Post
Is it possible to do "smallcaps" using CSS?
Yes, "font-variant: smallcaps" is the property to use. ADE, however does not display it (it displays a normal text font).

There is also "text-transform: uppercase", but that's only the caps part, not small. This is unsupported by ePUB and, of course, by ADE.
Jellby is offline   Reply With Quote
Old 05-26-2009, 05:41 AM   #32
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Goodness me - so there is.

Quote:
Originally Posted by Jellby View Post
Yes, "font-variant: smallcaps" is the property to use. ADE, however does not display it (it displays a normal text font).

There is also "text-transform: uppercase", but that's only the caps part, not small. This is unsupported by ePUB and, of course, by ADE.
pdurrant is offline   Reply With Quote
Advert
Old 05-26-2009, 08:53 AM   #33
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,635
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Quote:
Originally Posted by Jellby View Post
Yes, "font-variant: smallcaps" is the property to use. ADE, however does not display it (it displays a normal text font).

There is also "text-transform: uppercase", but that's only the caps part, not small. This is unsupported by ePUB and, of course, by ADE.
You could use the "text-transform: uppercase" and "font-size: small" to create a simile. Bit complicated but it LOOKS quite a bit like small caps.
mtravellerh is offline   Reply With Quote
Old 05-26-2009, 09:59 AM   #34
radius
Lector minore
radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.
 
radius's Avatar
 
Posts: 649
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Samsung Galaxy Tab S5e, Google Pixel Slate
Quote:
Originally Posted by mtravellerh View Post
You could use the "text-transform: uppercase" and "font-size: small" to create a simile. Bit complicated but it LOOKS quite a bit like small caps.
Ah. I didn't know there was smallcaps in CSS already.

However I just tried both that and text-transform: uppercase and they don't seem to work on the Sony Reader. I *does* look like a slightly different font but that might be a stroke weight thing from adjusting the size slightly.
radius is offline   Reply With Quote
Old 05-26-2009, 11:28 AM   #35
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by mtravellerh View Post
You could use the "text-transform: uppercase" and "font-size: small" to create a simile. Bit complicated but it LOOKS quite a bit like small caps.
That's probably what the client does to "fake" smallcaps when there is not a true smallcaps font available (and I'd say most wouldn't know when there is). The difference is:

Smallcaps: SMALLCAPS!

Uppercase+small: SMALLCAPS!

(note the S and ! sizes) Unless you do what I did here and apply different styles to different parts of the words. (By the way, I've seen not all browsers know to treat punctuation correctly with smallcaps.)

But... as I said, "font-variant: smallcaps" is at least recognized in the ePUB spec, whereas "text-transform: uppercase" isn't.
Jellby is offline   Reply With Quote
Advert
Old 05-26-2009, 11:30 AM   #36
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by radius View Post
However I just tried both that and text-transform: uppercase and they don't seem to work on the Sony Reader. I *does* look like a slightly different font but that might be a stroke weight thing from adjusting the size slightly.
No. The Sony uses ADE engine (afaIk), and ADE doesn't support either. But other readers might!
Jellby is offline   Reply With Quote
Old 08-02-2009, 03:03 PM   #37
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
I found that ADE was making huge margins around my eBooks even though I had them set to zero. The source file came from word and I found the following in the html file that I saved from word.
Quote:
@page Section1
{size:6.0in 9.0in;
margin:.6in .25in .5in .25in;}
div.Section1
{page:Section1;}
This data overrode all other data in the file so far as ADE was concerned and caused the margins to be set all around. I suggest his be removed if you use word as a source. Other ePUB display programs do not have this problelm.

Dale
DaleDe is offline   Reply With Quote
Old 08-06-2009, 03:39 AM   #38
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,635
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Quote:
Originally Posted by DaleDe View Post
I found that ADE was making huge margins around my eBooks even though I had them set to zero. The source file came from word and I found the following in the html file that I saved from word.

This data overrode all other data in the file so far as ADE was concerned and caused the margins to be set all around. I suggest his be removed if you use word as a source. Other ePUB display programs do not have this problelm.

Dale
margin in inches? God help us all!
mtravellerh is offline   Reply With Quote
Old 08-06-2009, 06:15 AM   #39
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,654
Karma: 127838196
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 mtravellerh View Post
margin in inches? God help us all!
That is because Word has stupidly large default margins and they are in inches.
JSWolf is online now   Reply With Quote
Old 08-23-2009, 02:59 PM   #40
afv011
Captain Penguin
afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.
 
afv011's Avatar
 
Posts: 2,944
Karma: 2077653593
Join Date: May 2009
Location: Vancouver, BC
Device: Kobo Libra 2, Nook Glowlight
Hi,

this code will display a solid horizontal line before and after some text, which can be used for chapters.

Code:
h1 {text-align:center;}

.solid-line {
    padding-left: 6em;
    font-size: .4em;
    vertical-align: middle;
    line-height: 1em;
    margin-left: 1em;
    margin-right: 1em;
    position: relative;
    bottom: .25em;
    background-color: black;
}
You would use it like this:

Code:
<h1><span class="solid-line">&nbsp;</span>Chapter One<span class="solid-line">&nbsp;</span></h1>
This controls the width of the line:
padding-left: 6em;

This controls the separation between the line and the text:
margin-left: 1em;
margin-right: 1em;
afv011 is offline   Reply With Quote
Old 08-23-2009, 05:18 PM   #41
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Could you use "display: inline-block" and "width: 6em; height: 3pt" or something like that? That would make "position", "line-height", "font-size", and &nbsp; unneeded...
Jellby is offline   Reply With Quote
Old 08-23-2009, 05:57 PM   #42
afv011
Captain Penguin
afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.afv011 ought to be getting tired of karma fortunes by now.
 
afv011's Avatar
 
Posts: 2,944
Karma: 2077653593
Join Date: May 2009
Location: Vancouver, BC
Device: Kobo Libra 2, Nook Glowlight
Quote:
Originally Posted by Jellby View Post
Could you use "display: inline-block" and "width: 6em; height: 3pt" or something like that? That would make "position", "line-height", "font-size", and &nbsp; unneeded...
I am no expert on CSS by any means, this is the best I could come up with - other people may have different, more efficient solutions than the one I proposed.

Last edited by afv011; 08-23-2009 at 10:53 PM.
afv011 is offline   Reply With Quote
Old 08-24-2009, 08:50 AM   #43
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,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
if the solid line is supposed to be out to the already existing margins, then you do not need the margin settings.
JSWolf is online now   Reply With Quote
Old 09-13-2009, 05:44 AM   #44
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Allowing images to resize to fit page width/height

By using XHTML and putting images in an svg wrapper, it's possible to get the images to resize to fill an entire page of the ebook reader, in proportion and centred. Here's the full xhtml file for my cover image.

The trick that made it work compared to my previous tries seems to be explicitly giving the picture width and height in the image object, to match the size of the viewBox. Previously I'd used 100% in there.


<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../styles/style001.css" type="text/css" />

<title></title>
</head>

<body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 573 800" preserveAspectRatio="xMidYMid meet">
<image width="573" height="800" xlink:href="../images/img0032.png" />
</svg>
</body>
</html>
pdurrant is offline   Reply With Quote
Old 09-29-2009, 11:24 PM   #45
quillaja
Connoisseur
quillaja began at the beginning.
 
quillaja's Avatar
 
Posts: 79
Karma: 42
Join Date: Sep 2009
Device: sony reader touch (prs-600)
i posted this in the forum, but am pasting it here in the 'repository'.
---
using the definition list <dl></dl> works really well for plays. it's also better xhtml, since it defines the relationship between the speaker's name and his or her dialog in a way that using simple paragraphs does not. of course, you can further customize these tags with CSS.

definition list is used as such:
Code:
<dl>
<dt>term</dt><dd>definition</dd>
<dt>term</dt><dd>definition</dd>
</dl>
you can also have multiple consecutive <dt> and <dd>.

for example:
Code:
<p><em>JobberA and JobberB enter</em></p>
<dl>
<dt>JobberA</dt>
<dd>Wow, I really love e-books!</dd>
<dt>JobberB</dt>
<dd>Indeed! I do declare they are good. In fact, I will sing their praises!
  <p><em>JobberB sings.</em></p>
  <blockquote>
    e-books are really great<br/>
    ded-tree books i now do hate.
  </blockquote>
</dd>
</dl>
<p><em>Exit all.</em></p>
You'll notice that in JobberB's part, another <p> and <blockquote> are nested.

I also like to make the speaker names bold, because sony reader doesn't automatically format the <dt> to be bold, as most web browsers do (i think).

anyway, just thought i'd throw this tidbit out there. i used it in some books i published on feedbooks.

As GRiker said, <dl> might also be nice for a table of contents, where <dt> holds the link and <dd> holds a description.
quillaja 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
direkter Umlaut oder lieber HTML Code in Epub ? NASCARaddicted Erste Hilfe 14 06-16-2011 05:54 AM
Programming language code snippets in ebooks? Connochaetes Writers' Corner 7 10-18-2010 02:43 PM
ebook-convert HTML to EPUB and problem with <pre><code> mikegr Calibre 2 03-09-2010 02:27 PM
css override code for margins? Amalthia Calibre 15 08-11-2009 07:20 PM
Problems generating ePub from HTML/CSS AlexBell Calibre 3 07-17-2009 05:10 AM


All times are GMT -4. The time now is 01:16 PM.


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