View Single Post
Old 10-07-2010, 04:17 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 citac View Post
I tried embedding but couldn't get it to work the first time. I can't afford to spend a lot of time on it since the exam is not that far away but I'll return to the FAQ, it will be useful in the future.
Font embedding is not difficult. Here are the things one needs to do (examples taken from the wonderful Three Men in a Boat epub):

1. Add the font file(s) (TTFs or OTFs) to the book by right-clicking anywhere in the Book Browser, selecting "Add existing items" and then selecting the files to add.

2. Add @font-face style rules to your CSS that reference the fonts you just added. This makes the fonts available to the rest of the style rules.

Here's an example of what it should look like:

Code:
 @font-face {
   font-family: "Fontin";
   font-weight: normal;
   font-style: normal;
   src: url(../Fonts/Fontin-Regular.ttf);
 }
 
 @font-face {
   font-family: "Fontin";
   font-weight: bold;
   font-style: normal;
   src: url(../Fonts/Fontin-Bold.ttf);
 }
 
 @font-face {
   font-family: "Fontin";
   font-weight: normal;
   font-style: italic;
   src: url(../Fonts/Fontin-Italic.ttf);
 }
3. Add a style to the CSS that assigns the new font family to some part of the book; here the font is assigned to the book's "body", which basically means everything unless specified otherwise:

Code:
body {
  font-family: "Fontin", serif;
}
Note that the style rule that uses a new font family name has to come after the @font-face rules that declare it. Also note that because of a Qt bug, font variants (bold, italic etc.) for embedded fonts may or may not actually show up in Sigil's Book View. But the "normal" version of the font should. And of course, all the variants should display just fine in Adobe Digital Editions.

That's it. This was just an overview, take a look a the Three Men in a Boat epub book that I linked to previously. It's available for download (for free) right here on MobileRead and it opens just fine in Sigil.

Hm... I should probably put this in the FAQ.

Quote:
Originally Posted by citac View Post
Ne mogu ti opisati koliko me nervira ta njihova glupost! Kratkovidni idioti. A imam puno zabilješki koje bih trebala prekucati i konvertovati...
To ti je ono kad ameri misle da se cijeli svijet vrti oko njih... što da ti kažem, sve već znaš...

Quote:
Originally Posted by citac View Post
So... how much time are we talking about?
You'll have to ask the Qt guys. It's up to them.

Last edited by Valloric; 10-07-2010 at 04:21 AM.
Valloric is offline   Reply With Quote