Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-09-2010, 09:02 PM   #1
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Different font for headings

Hi, I'd appreciate some help. I'm trying to use one font (georgia.tff) for the body and a different font (DroidSans-Bold.ttf) for the headings.

Here's my CSS:

p {margin-left:5%; margin-right:5%; margin-top:0;margin-bottom:0; padding:0;text-indent:1.1em;font-size:120%}
p.space{margin-left:5%; margin-right:5%; margin-top:2%;margin-bottom:0; padding:0;font-size:120%}
p.space1{margin-left:5%; margin-right:5%; margin-top:4%;margin-bottom:0; padding:0;font-size:120%}

div.ignore {margin-left:5%; margin-right:5%; margin-top:0;margin-bottom:0; padding:0;font-size:120%}

@font-face { font-family: "Georgia"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/georgia.ttf); }
@font-face { font-family: "Georgia"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/georgiai.ttf); }
@font-face { font-family: "Heading"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/DroidSans-Bold.ttf); }

body { font-family: "Georgia", serif; }

h2 {font-family: "Heading", serif; margin-left:5%; text-align: left; margin-bottom: 2cm; font-weight:bold}

div.sgc-1 {text-align: center}
div.sgc-3 {text-align: center;}
h1.sgc-2 {text-align: center;}
p.sgc-4 {font-style: italic}
p.sgc-1 {font-style: italic}
span.sgc-5 {letter-spacing:2px}



I save it to my Sony 505 and the Droid font overrides the Georgia, so that everything, heading and body included, comes out in Droid.

Would love some help, thanks

Last edited by bremler; 03-09-2010 at 09:04 PM.
bremler is offline   Reply With Quote
Old 03-09-2010, 09:18 PM   #2
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by bremler View Post
@font-face { font-family: "Heading"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/DroidSans-Bold.ttf); }

body { font-family: "Georgia", serif; }

h2 {font-family: "Heading", serif; margin-left:5%; text-align: left; margin-bottom: 2cm; font-weight:bold}
Not sure if it's the cause, but I highlighted a problem in your font definitions. You're telling the renderer you want to use a bold weight for the 'Heading' font-family, but only defined a normal weight.
charleski is offline   Reply With Quote
Advert
Old 03-09-2010, 09:23 PM   #3
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Thanks charleski, I solved it. Sigil had added some extra tags to my headings, so they looked something like this: <h2 heading_id>Chapter 1</h2>.

So I went through and deleted the heading_id to make it just <h2> and now both fonts show up where they should be :-)
bremler is offline   Reply With Quote
Old 03-10-2010, 07:40 AM   #4
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by bremler View Post
Thanks charleski, I solved it. Sigil had added some extra tags to my headings, so they looked something like this: <h2 heading_id>Chapter 1</h2>.

So I went through and deleted the heading_id to make it just <h2> and now both fonts show up where they should be :-)
Now your TOC probably doesn't work. IDs are added to headings so that they can be referenced from the NCX file. Removing the ID makes the reference invalid if you removed it from outside Sigil. If you removed it inside Sigil, in the Code View, a new ID was added to the heading on export.

And removing the ID should not have solved your CSS issue with the CSS code you posted. It was probably something else.

Last edited by Valloric; 03-11-2010 at 09:26 AM. Reason: typo
Valloric is offline   Reply With Quote
Old 03-11-2010, 06:03 AM   #5
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Hi Valloric, no, TOC works ok. I edited the tags within Sigil, knowing that Sigil would recreate them. And it did, but fonts remain intact.
bremler is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to separate paragraphs and headings in Book View amoroso Sigil 2 07-12-2010 08:27 AM
Repeated Chapter Headings in Kobo Table of Contents capsolo Sigil 5 06-20-2010 03:09 AM
Detect chapter headings with capitalized words fiendmish Calibre 6 05-31-2010 10:45 AM
Managing HTML Link Behavior, From TOC to Chapter Headings FlooseMan Dave Calibre 1 03-31-2010 11:55 PM
Image maps as Chapter Headings? kjk Sigil 6 10-17-2009 06:27 PM


All times are GMT -4. The time now is 03:11 PM.


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