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
|