Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2020, 07:17 AM   #1
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
Add fonts to Calibre epub

I'm having trouble with embedding fonts in Calibre. The conversion from docx to epub is no problem. Everything looks fine in the Calibre viewer, even the fonts.
But I only get to see the choosen fonts in the Calibre viewer. Not in Adobe Digital Editions, not in the e-reader on my iPhone. It doesn't matter whether or not I choose to embed the fonts I used in my docx or not.
Nor does it seem to help if I install the fonts when setting up the conversion in Calibre.

So I decided to see what I could do with CSS. When I edit my epub in Calibre, there is no mention of fonts on the left side (were all the CSS stuff is shown). Again, whether I've embedded them or not during the setup for conversion. It simply says Fonts: 0.

In the stylesheet, both fonts I use, are mentioned (and again, whether I've embedded them or not during the setup for conversion). But are still only visible in the Calibre viewer. Not in ADE or on my phone.

I've also tried it with a docx without the choosen fonts, hoping I could add the fonts when editing the epub.

And I can't install the font families. I looks like it does, I can choose and add them, but they don't appear in the list.
I'm using two Google fonts, so it should be working.

How do I add fonts to the Font stylesheet mentioned on the left side of the edit screen? How do I make the fonts visible in other readers beside Calibre?

Hopefully some of you have the solution for me!
Mohrwyn is offline   Reply With Quote
Old 04-09-2020, 09:18 AM   #2
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
It is hard to tell exactly what your problem is from the description. Also, it is possible that your e-readers do not display embedded fonts until a specific setting is made, as is necessary with Kindles.

Below are the steps I take to successfully embed fonts. Perhaps it will help you...

1) in Edit tool, import .ttf or .otf file previously downloaded from Google Fonts. Calibre will automatically put that file in its Fonts section.

2) in CSS file, add font-face rule. e.g.
@font-face {
font-family: "Lobster";
src: url(../Lobster_1.3.otf);
}

3) add font to rules e.g.
h2 {
font-size: 2em;
font-family: "Lobster", cursive;
color: #8f0bf4;
text-shadow: 2px 2px 2px #000;
}
Brett Merkey is offline   Reply With Quote
Advert
Old 04-09-2020, 10:56 AM   #3
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
the other approach is to accept that the reader will select the font, not the author. both kindles and Kobo devices offer 6 or more fonts which you can select using the device menus( plus it is not hard to add fonts to the device, which all books can then access)
all that the book has to do is NOT try to enforce a font, so that the reader device can take control
( same goes for line heights, margins, justification )

can't speak for i phones, don't have one... but the apple philosophy is all users are idiots, lock everything down... so forcing any font to show up on an apple device may be problematic.
stumped is offline   Reply With Quote
Old 04-09-2020, 12:29 PM   #4
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: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Wy do you need to embed fonts? Are you doing this for yourself or to sell? If it is for yourself, what device and software are you using to read with?

If this is an eBook for sale, are you embedding a font that going to be used as the body font? If so, are you 100% sure you need to do this? Embedding a font for the body is not a good idea.
JSWolf is offline   Reply With Quote
Old 04-09-2020, 12:37 PM   #5
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: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The following code will embed the font ChareInk. The source URL will have to be changed for where your fonts are relative to he CSS. This embeds all 4 font styles in the font family.

Code:
@font-face {
font-family:"ChareInk";
font-style: normal;
font-weight: normal;
src: url(../fonts/ChareInk-Regular.ttf);
}
@font-face {
 font-family:"ChareInk"; 
 font-style: normal; 
 font-weight: bold; 
 src: url(../fonts/ChareInk-Bold.ttf);
}
@font-face {
 font-family:"ChareInk";
 font-style: italic; 
 font-weight: normal; 
 src: url(../fonts/ChareInk-Italic.ttf);
}
@font-face {
 font-family:"CharInk"; 
 font-style: italic; 
 font-weight: bold; 
 src: url(../fonts/ChareInk-BoldItalic.ttf);
}
JSWolf is offline   Reply With Quote
Advert
Old 04-09-2020, 12:40 PM   #6
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: 73,987
Karma: 128903378
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 Brett Merkey View Post
3) add font to rules e.g.
h2 {
font-size: 2em;
font-family: "Lobster", cursive;
color: #8f0bf4;
text-shadow: 2px 2px 2px #000;
}
I don't know of any software that would use a cursive font if Lobster didn't exist. Also, if Lobster didn't exist, then you have a serious issue with your ePub that needs to be fixed. So you can dump cursive. The CSS line you want is just
Code:
Font-family: "Lobster";
The only advantage I see in doing something like font-family: "font", sans-serif; means it's easy for me to just dump that line to just sans-serif if I don't want that font embedded.
JSWolf is offline   Reply With Quote
Old 04-09-2020, 12:41 PM   #7
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: 73,987
Karma: 128903378
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 stumped View Post
the other approach is to accept that the reader will select the font, not the author. both kindles and Kobo devices offer 6 or more fonts which you can select using the device menus( plus it is not hard to add fonts to the device, which all books can then access)
all that the book has to do is NOT try to enforce a font, so that the reader device can take control
( same goes for line heights, margins, justification )

can't speak for i phones, don't have one... but the apple philosophy is all users are idiots, lock everything down... so forcing any font to show up on an apple device may be problematic.
I have sometimes left in some fonts if they are for decoration say the chapter titles.
JSWolf is offline   Reply With Quote
Old 04-09-2020, 01:29 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
The Calibre editor will offer up a CSS template when you add (import) a font file. (you do need to touch up the weight, style )
theducks is offline   Reply With Quote
Old 04-09-2020, 03:27 PM   #9
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
Thank you for your explanation. The problem is your first step. Calibre does not add the installed fonts to the fonts section. Only to the stylesheet.css. I thought that's why the fonts didn't show up in other devices.

Reading the other replies, I'm starting to doubt putting in my own fonts...
Mohrwyn is offline   Reply With Quote
Old 04-09-2020, 03:28 PM   #10
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
That's food for thought, thank you so much! I'll reconsider putting in my own fonts.
Mohrwyn is offline   Reply With Quote
Old 04-09-2020, 03:29 PM   #11
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
It's for sale. Reading all the replies made me reconsider whether or not to put in my own fonts... Thank you!
Mohrwyn is offline   Reply With Quote
Old 04-09-2020, 03:31 PM   #12
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
Reading all the replies, I'm reconsidering putting in my own fonts. But if I decide to, I'll certainly give your css example a try! Thank you.
Mohrwyn is offline   Reply With Quote
Old 04-09-2020, 04:02 PM   #13
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: 73,987
Karma: 128903378
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 Mohrwyn View Post
Reading all the replies, I'm reconsidering putting in my own fonts. But if I decide to, I'll certainly give your css example a try! Thank you.
Are you embedding for use as the body font or for other uses such as the chapter header?
JSWolf is offline   Reply With Quote
Old 04-10-2020, 04:35 AM   #14
Mohrwyn
Member
Mohrwyn began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
Quote:
Originally Posted by JSWolf View Post
Are you embedding for use as the body font or for other uses such as the chapter header?
I had fonts for both. But if I better not embed a font for the body text, then it's hardly necessary to embed one for the chapter headers. I can simply choose a serif font for the chapter headers to differ them from the (sans serif) body text.
Mohrwyn is offline   Reply With Quote
Old 04-10-2020, 06:11 AM   #15
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: 73,987
Karma: 128903378
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 Mohrwyn View Post
I had fonts for both. But if I better not embed a font for the body text, then it's hardly necessary to embed one for the chapter headers. I can simply choose a serif font for the chapter headers to differ them from the (sans serif) body text.
Good idea to drop the embedded fonts. The other thing you would have to do is is check if the fonts you were going to embed were acceptable for use with eInk. A lot of fonts are too light for use with eInk. I've seen too many eBooks using Adobe Garamond to match the print edition and it's way too light for eInk.
JSWolf is offline   Reply With Quote
Reply

Tags
calibre, embedding, epub, font


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to embed fonts in ePub after Calibre fiery ePub 79 12-05-2016 02:18 AM
fontencrypt.py - Add Adobe encryption to fonts in ePub pdurrant ePub 14 10-15-2013 09:16 AM
How to add alternate fonts without replacing system fonts.(this time this is a guide) techiemonkey Kindle Developer's Corner 17 09-12-2012 04:55 PM
Calibre 6 and ePub changing fonts? dordale Calibre 7 08-03-2009 04:30 PM


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


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