Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-08-2010, 10:38 PM   #1
JaneFancher
Zealot
JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.
 
JaneFancher's Avatar
 
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
Embedding fonts with Sigil and Calibre

I'm posting here, hoping maybe somebody has some ideas.

I'm having mixed success in embedding my fonts into my epub files. I make a nice clean html file of my entire book. Views perfectly in FireFox. I import the html into Calibre, add cover and metadata and convert to epub.

I import the file into Sigil and while special fonts don't show in Calibre, the .Calibre* definitions appear in the generated style.css file. I import the font files into the font folder and add the following to the style.css file (bold is the calibre generated code:

@namespace h "http://www.w3.org/1999/xhtml";


.calibre {
display: block;
font-family: "Times New Roman", serif;
font-size: 1em;
font-style: normal;
font-weight: normal;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
page-break-before: always;
text-align: justify
}

@font-face {
font-family: "Vivaldi", cursive;
font-style: normal;
font-weight: normal;
src:url(../Fonts/Vivaldii.TTF) format(opentype);;
}

@font-face {
font-family: "Trajan Pro", serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/TrajanPro-Bold.otf) format(opentype);;
}

@font-face {
font-family: "HansonsHand", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/HANSON-H.TTF) format(opentype);;
}

@font-face {
font-family: "Schwarzwald", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/SCHWARZW.TTF) format(opentype);;
}

@font-face {
font-family: "BankGothic Md BT", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/BNKGOTHM.TTF) format(opentype);;
}

@font-face {
font-family: "Brush Script MT Italic", cursive;
font-style: normal;
font-weight: normal;
src:url(../Fonts/BRUSHSCI.TTF) format(opentype);;
}

.calibre1 {
display: block;
font-size: 2em;
font-weight: bold;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
margin-top: 0.67em;
page-break-before: always;
text-align: justify;
text-indent: 0.2in
}


Saving down, this epub file looks perfect in mobipocket and firefox epub reader, but when I bring it back into Calibre, the special fonts don't show and the default font has suddenly gone huge and bold...almost like h1, but I've checked all the files and there are not orphan h1 or h2 tags.

Does anyone have any idea what might be going on?

Many thanks
JaneFancher is offline   Reply With Quote
Old 04-09-2010, 01:35 AM   #2
JaneFancher
Zealot
JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.
 
JaneFancher's Avatar
 
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
Update: I got to really looking at the handful of paragraphs showing correctly in Calibre and found a single code that they [I]didn't[I] have in common with the paragraphs appearing incorrectly. It was an apparently extraneous font definition. Extraneous because the "body style" description should have taken care of that.

So...I wiped that one line and got it out of the way of the default font and everything seems ok now in Calibre, at least, although it still doesn't show the specialty fonts.

More confusingly...I wonder why the problem didn't show up until I put the @font code in.

For the record, I wrote my original file in WordPerfect. When I published to html, WP put a font style code in every paragraph, as well as a default font style at the top of the file. Department of redundancy department. That is the source of the extraneous style code.

Anyway, just a heads up for anyone trying to do this font embedding stuff.
JaneFancher is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil 0.2.0 Embedding Fonts - Adding all the bits ghostyjack Sigil 30 05-14-2011 04:30 AM
Embedding fonts with Sigil? MacEachaidh Sigil 4 08-20-2010 08:16 AM
Embedding fonts JaneFancher Calibre 14 04-10-2010 10:28 PM
Embedding fonts AprilHare ePub 6 01-02-2010 12:42 PM
Embedding fonts jash Calibre 2 09-09-2008 06:05 PM


All times are GMT -4. The time now is 12:44 AM.


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