11-11-2016, 04:20 PM | #1 |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
Calibre will only embed certain fonts and not others. Why?
Often I get this error message:
Failed to find font matching: ... See attached image. How come? How do I know which font it will embed, and which it wont? |
11-11-2016, 06:38 PM | #2 |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
are those variations installed on your system?
Do they allow embedding (in the fonts properties)? |
Advert | |
|
11-11-2016, 08:52 PM | #3 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There are many possible problems in font files that can prevent them from being matched. Impossible to say what the problem is with your particular fonts without access to the font files.
|
11-12-2016, 06:34 AM | #4 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Maybe he is looking for the wrong weight 400 and 700? Bookman old is part of MS Office, but weight there is 300 and 600
|
11-12-2016, 11:24 AM | #5 |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
@theducks
These fonts are installed on a Win10 machine. I'm converting from Word, so not specifying the variations. Even though Calibre gives me that error, when I view the epub in the Calibre viewer it displays with those fonts. When I view elsewhere, of course it doesn't display them. @divingduck What program is that you're using? I'd be happy to post a screenshot using that same app if it will help. |
Advert | |
|
11-12-2016, 11:41 AM | #6 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
It's a nice tool called Inside Fonts (http://www.insidefont.de/en/index.html).
|
11-12-2016, 12:40 PM | #7 |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
I only included one font.
One thing I will also bring up, is whenever I embed fonts during a conversion, whenever I open the file in the editor, and click the check for bugs button, it gives me this error for every font that's successfully embedded: Code:
CSS: Property: Not valid for profile "['CSS Fonts Module Level 3 @font-face properties']" but valid "CSS Fonts Module Level 3" value: normal [9:5: font-stretch] [page_styles.css] |
11-12-2016, 12:42 PM | #8 |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
Thank you @divingduck for this program.
|
11-12-2016, 12:58 PM | #9 |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
Since this program told me that the Cochin font I like is on my system in 500 weight, I edited the code in stylesheet.css.
I changed font-weight: normal to font-weight: 500 Looking towards a solution to this, please forgive me for reiterating: I did not initially specify a font weight. All I did was convert a Word docx file to epub. The only check boxes of consequence that I have checked in the conversion process are Embed all fonts in document and Subset all fonts in document. Based on the error messages I've gotten, I am guessing most programs understand font-weight: normal to = 400. Is that the spec? Yes it is: Per: https://www.w3.org/wiki/CSS/Properties/font-weight The keyword 'normal' is synonymous with '400', and 'bold' is synonymous with '700'. Last edited by hidden.platypus; 11-12-2016 at 01:08 PM. Reason: Answered own question |
11-12-2016, 08:39 PM | #10 | |
Evangelist
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
Also, Calibre needs to map the CSS font-weight names into numbers. I had the following fail to find a matching font: Code:
.text-western { font-family: "Playbill", "Wanted", serif; font-size: 2em; font-stretch: extra-condensed; font-weight: medium; } Code:
.text-western { font-family: "Playbill", "Wanted", serif; font-size: 2em; font-stretch: extra-condensed; font-weight: 500; } |
|
11-12-2016, 08:46 PM | #11 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no such thing as font-weight: medium
The only keywords allowed for font-weight are: normal | bold | bolder | lighter and all of those calibre correctly handles. https://developer.mozilla.org/en/doc...SS/font-weight |
11-12-2016, 08:50 PM | #12 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And how is calibre supposed to give you more information about a font that has not been embedded, since the only information it has is the information already visible to you in the CSS rules? I suppose I could have the embed font button popup a report that shows why fonts with matching family names did not match fully.
|
11-12-2016, 08:53 PM | #13 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@hidden.platypus: There is no good solution to going from docx to epub and embedding fonts that have non-standard attributes, short of having the docx input plugin look for the font files and create complete CSS rules for them, which is not very robust, since the font files may or may not be present on the system when the docx file is being converted. You should embed the fonts in the docx file before conversion, then you are guaranteed that they wil be present in the epub after conversion.
Last edited by kovidgoyal; 11-12-2016 at 08:57 PM. |
11-13-2016, 07:07 AM | #14 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Kovid,
I made a short experiment on an simple word document (version 2016). The document uses a standard setup with calibri font set including some lines of text and headlines. Used fonts are calibri for text and calibri light for headings (standard word setup too). The first version was saved without fonts and then open directly with the calibre editor. Then I try to embed the fonts used. The editor was able to find the text font calibri but not the font calibri light used for headings. So fare so good (or not). For the next test I embed the fonts in the word document and open the file direct in the calibre editor. Everything goes well and all fonts are in the epub as expected. Then I delete manually the fonts files in the epub and try again to embed them within calibre editor. Same situation as in first test. calibre can't find the font calibri light. After that I took a look inside the docx files specially for the fontTabel.xml. The information are more or less the same (excluding the references for embedded fonts) So, the question for me is, why is calibre able to find font calibri regular and what is preventing calibre to find the font calibri light if both are standard fonts in the OS with no exotic setup? I can't remember when I did the last time this kind of evaluations but I can't remember that I had seen that for standard fonts in the past (I add fonts in my workflow most times manually if needed). Maybe I had forgot to test it or thought as Kovid this happen to me with some of my not standard fonts. Who knows. Kovid, let me know if you like to see the samples. Best regards, DivingDuck |
11-13-2016, 07:56 AM | #15 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibri light is probably not a regular font. If you want it to be detected you have to specify the correct font-weight, font-stretch etc. properties in the css rule referencing the font. If you find the editor is unable to embed the font after specifying the correct properties, then by all means send me a sample, witht he font files as well.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can it embed fonts? | chalimac | Kobo Reader | 1 | 06-27-2017 05:46 PM |
How to embed fonts in ePub after Calibre | fiery | ePub | 79 | 12-05-2016 02:18 AM |
Is it possible to really embed fonts yet? | LaurelRusswurm | ePub | 25 | 11-17-2011 10:25 PM |
Is it possible to UN embed fonts? | lmronan | Sigil | 14 | 06-04-2010 09:26 AM |