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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2010, 07:08 PM   #1
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
Possible to embed fonts in CSS of .lit file?

Before I start, I'd like to say that Calibre is an amazingly awesome program!! I've been using it for a few months and am quite impressed. I apologize if there is a thread for this and I just haven't found it but, is it at all possible to embed fonts in a .lit file using the "Extra CSS" box in the Look and Feel section? I know you can for epub but is it similar for all outputs? And if not how do you get custom fonts in .lit files?
tanzer21 is offline   Reply With Quote
Old 06-11-2010, 08:21 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, i'm afraid there's no way to embed fonts in lit files using calibre. Indeed I know of no way to embed fonts in lif files, period.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-11-2010, 08:50 PM   #3
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: 76,425
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Actually, there is a way. I've done it. Not on purpose, but by accident.

I too an ePub that had embedded fonts for use on my 505. But in Firefox, the base font did display because it was one of the ones I have in my fonts directory. So, when I converted that ePub to MS Reader, the base font was the same one I had specified.

Code:
@font-face {
  font-family: "Fontin";
  font-weight: normal;
  font-style: normal;
  src: url(res:///Data/fonts/Fontin-Regular.ttf);
}
@font-face {
  font-family: "Fontin";
  font-weight: bold;
  font-style: normal;
  src: url(res:///Data/fonts/Fontin-Bold.ttf);
}
@font-face {
  font-family: "Fontin";
  font-weight: normal;
  font-style: italic;
  src: url(res:///Data/fonts/Fontin-Italic.ttf);
}
@font-face {
  font-family: "Fontin_Sans";
  font-weight: normal;
  font-style: normal;
  src: url(res:///Data/fonts/Fontin_Sans_R_45b.otf);
}
@font-face {
  font-family: "Fontin_Sans";
  font-weight: bold;
  font-style: normal;
  src: url(res:///Data/fonts/Fontin_Sans_B_45b.otf);
}
@font-face {
  font-family: "Fontin_Sans";
  font-weight: normal;
  font-style: italic;
  src: url(res:///Data/fonts/Fontin_Sans_I_45b.otf);
}
@font-face {
  font-family: "Fontin_Sans" ;
  font-weight: bold ;
  font-style: italic ;
  src: url(res:///Data/fonts/Fontin_Sans_BI_45b.otf) ;
}
body {
  font-family: "Fontin", serif;
  widows: 0;
  orphans: 0
}
That is the CSS used in the ePub and Fontin is installed in Windows.
JSWolf is offline   Reply With Quote
Old 06-11-2010, 09:49 PM   #4
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
Thank you both for the info. JSWolf, I'm going to give it a whirl and see if it works. Kovidgoyal, awesome work with Calibre, keep up the great updates
tanzer21 is offline   Reply With Quote
Old 06-11-2010, 09:57 PM   #5
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
So I tried it but it doesn't seem to work. Is it because my fonts folder is in a different place? Would I input it then as:

src: url(res:///Windows/fonts/Fontin-Regular.ttf);

for this one?
src: url(res:///Data/fonts/Fontin-Regular.ttf);
tanzer21 is offline   Reply With Quote
Advert
Old 06-11-2010, 10:15 PM   #6
Stinger
Asha'man
Stinger has learned how to read e-booksStinger has learned how to read e-booksStinger has learned how to read e-booksStinger has learned how to read e-booksStinger has learned how to read e-booksStinger has learned how to read e-booksStinger has learned how to read e-books
 
Stinger's Avatar
 
Posts: 335
Karma: 844
Join Date: May 2010
Location: Canada
Device: Kobo
Quote:
Originally Posted by JSWolf View Post
Actually, there is a way. I've done it. Not on purpose, but by accident.

I too an ePub that had embedded fonts for use on my 505. But in Firefox, the base font did display because it was one of the ones I have in my fonts directory. So, when I converted that ePub to MS Reader, the base font was the same one I had specified.

Spoiler:
@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Regular.ttf);
}
@font-face {
font-family: "Fontin";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin-Bold.ttf);
}
@font-face {
font-family: "Fontin";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin-Italic.ttf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_R_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Fontin_Sans_B_45b.otf);
}
@font-face {
font-family: "Fontin_Sans";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Fontin_Sans_I_45b.otf);
}
@font-face {
font-family: "Fontin_Sans" ;
font-weight: bold ;
font-style: italic ;
src: url(res:///Data/fonts/Fontin_Sans_BI_45b.otf) ;
}
body {
font-family: "Fontin", serif;
widows: 0;
orphans: 0
}


That is the CSS used in the ePub and Fontin is installed in Windows.
This isn't really embedding the font within the .LIT though, just referencing to a system available font. A different can of beans entirely.
Stinger is offline   Reply With Quote
Old 06-11-2010, 10:18 PM   #7
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
But if the referencing of the font lets me read it in a different font that works for me since that's what I'm trying to achieve ultimately. So maybe I should have rephrased my question in the sense that how can I get my msreader to detect a certain font rather than the preset Berling Antiqua?
tanzer21 is offline   Reply With Quote
Old 06-11-2010, 10:33 PM   #8
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
So trial and error wise, I got it to work for one book but not for another, it just does the table of contents on one, so looking at the CSSstyle sheet, would I need to substitute the word "body" for something else?
tanzer21 is offline   Reply With Quote
Old 06-21-2010, 11:17 AM   #9
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: 76,425
Karma: 136564696
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 tanzer21 View Post
So I tried it but it doesn't seem to work. Is it because my fonts folder is in a different place? Would I input it then as:

src: url(res:///Windows/fonts/Fontin-Regular.ttf);

for this one?
src: url(res:///Data/fonts/Fontin-Regular.ttf);
I didn't make any changes in the CSS I used for my 505. It just worked. But, the font is Fontin and I used the name Fontin as the font family name. So My guess is that it's calling the correct font because I used the font's name. Try it with other fonts but use the name of the font family when you reference the font. I'm guessing that the @font declaration may have nothing to do with this.
JSWolf is offline   Reply With Quote
Old 06-30-2010, 08:26 PM   #10
tanzer21
Member
tanzer21 began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2010
Device: Microsoft Reader
Thanks everyone for the input, I've figured it out. It IS possible to change your fonts in .lit with this:

@font-face { font-family: "Centaur MT";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/Centaur MT.ttf);
}

@font-face { font-family: "Centaur MT";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/Centaur MT Bold.ttf)
; }

@font-face { font-family: "Centaur MT";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/Centaur MT Italic.ttf);
}

body { font-family: "Centaur MT", serif;
widows: 0;
orphans: 0
}

In this example I'm using the Centaur MT font that I have. Just substitute the font info for the ones that you want to use and it works perfectly. Thanks all for your help
tanzer21 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
Can it embed fonts? chalimac Kobo Reader 1 06-27-2017 06:46 PM
How to embed fonts in ePub after Calibre fiery ePub 79 12-05-2016 03:18 AM
Best Practice: Embed Fonts?? luthar28 ePub 37 11-01-2011 05:16 AM
Is it possible to UN embed fonts? lmronan Sigil 14 06-04-2010 10:26 AM
Any free software can embed fonts in epub droople ePub 4 03-06-2010 06:40 PM


All times are GMT -4. The time now is 11:33 AM.


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