![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
|
Embed font family Ebook conversion from content server
Why calibre content server doesn't find the fonts installed?
Version: calibre-server (calibre 5.14) Steps to reproduce: 1. SSH into machine and install font with Code:
sudo apt install fonts-open-sans Code:
Traceback (most recent call last): File "calibre/utils/fonts/scanner.py", line 225, in fonts_for_family KeyError: 'open-sans' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre/ebooks/oeb/transforms/flatcss.py", line 229, in get_embed_font_info File "calibre/utils/fonts/scanner.py", line 227, in fonts_for_family calibre.utils.fonts.scanner.NoFonts: No fonts found for the family: 'open-sans' Last edited by edgargal; 05-05-2021 at 03:37 PM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,199
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I highly doubt the actual font family name for the font is "open-sans". Use the actual font family and make sure it is showing up when you run fc-list as the same user you are running the content server as.
|
![]() |
![]() |
![]() |
#3 |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
|
I also tried Open Sans OpenSans-Regular, Open Sans Semibold.
What am I doing wrong? Code:
calibre@server:~$ fc-list | grep "Open Sans" /usr/share/fonts/truetype/open-sans/OpenSans-Light.ttf: Open Sans,Open Sans Light:style=Light,Regular /usr/share/fonts/truetype/open-sans/OpenSans-CondLight.ttf: Open Sans,Open Sans Condensed Light:style=Condensed Light,Regular /usr/share/fonts/truetype/open-sans/OpenSans-Regular.ttf: Open Sans:style=Regular /usr/share/fonts/truetype/open-sans/OpenSans-ExtraBoldItalic.ttf: Open Sans,Open Sans Extrabold:style=Extrabold Italic,Italic /usr/share/fonts/truetype/open-sans/OpenSans-Italic.ttf: Open Sans:style=Italic /usr/share/fonts/truetype/open-sans/OpenSans-SemiboldItalic.ttf: Open Sans,Open Sans Semibold:style=Semibold Italic,Italic /usr/share/fonts/truetype/open-sans/OpenSans-CondLightItalic.ttf: Open Sans,Open Sans Condensed Light:style=Condensed Light Italic,Italic /usr/share/fonts/truetype/open-sans/OpenSans-ExtraBold.ttf: Open Sans,Open Sans Extrabold:style=Extrabold,Regular /usr/share/fonts/truetype/open-sans/OpenSans-LightItalic.ttf: Open Sans,Open Sans Light:style=Light Italic,Italic /usr/share/fonts/truetype/open-sans/OpenSans-Semibold.ttf: Open Sans,Open Sans Semibold:style=Semibold,Regular /usr/share/fonts/truetype/open-sans/OpenSans-BoldItalic.ttf: Open Sans:style=Bold Italic /usr/share/fonts/truetype/open-sans/OpenSans-Bold.ttf: Open Sans:style=Bold /usr/share/fonts/truetype/open-sans/OpenSans-CondBold.ttf: Open Sans Condensed:style=Bold |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,199
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No clue, sorry. Have you restarted the server since installing the fonts?
|
![]() |
![]() |
![]() |
#5 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
|
Quote:
I never used (started) the GUI. I also updated to 5.17 and got the same error. Code:
Traceback (most recent call last): File "calibre/utils/fonts/scanner.py", line 225, in fonts_for_family KeyError: 'open sans' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre/ebooks/oeb/transforms/flatcss.py", line 229, in get_embed_font_info File "calibre/utils/fonts/scanner.py", line 227, in fonts_for_family calibre.utils.fonts.scanner.NoFonts: No fonts found for the family: 'Open Sans' Last edited by edgargal; 05-06-2021 at 10:15 AM. |
|
![]() |
![]() |
![]() |
#6 |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
|
I tried using ebook-convert and it returned expected behavior.
Code:
calibre@server:~$ ebook-convert 'parasitic.epub' out.epub --embed-font-family 'Open Sans' --filter-css 'font-family' Conversion options changed from defaults: embed_font_family: 'Open Sans' filter_css: 'font-family' 1% Converting input to HTML... InputFormatPlugin: EPUB Input running on /home/calibre/parasitic.epub Found HTML cover titlepage.xhtml Parsing all content... Referenced file 'e9781621579939/styles/SS_global.css' not found Referenced file 'e9781621579939/images/9781621579939.jpg' not found Referenced file 'e9781621579939/styles/9781621579939.css' not found 34% Running transforms on e-book... Merging user specified metadata... Detecting structure... Detected chapter: CHAPTER ONE From Civil War to the Battle of Ideas Detected chapter: CHAPTER TWO Thinking versus Feeling, Truth versus Detected chapter: CHAPTER THREE Non-Negotiable Elements of a Free an Detected chapter: CHAPTER FOUR Anti-Science, Anti-Reason, and Illibe Detected chapter: CHAPTER FIVE Campus Lunacy: The Rise of the Social Detected chapter: CHAPTER SIX Departures from Reason: Ostrich Parasi Detected chapter: CHAPTER SEVEN How to Seek Truth: Nomological Netwo Detected chapter: CHAPTER EIGHT Call to Action Detected chapter: Chapter One From Civil War to the Battle of Ideas Detected chapter: Chapter Two Thinking versus Feeling, Truth versus Detected chapter: Chapter Three Non-Negotiable Elements of a Free an Detected chapter: Chapter Four Anti-Science, Anti-Reason, and Illibe Detected chapter: Chapter Five Campus Lunacy: The Rise of the Social Detected chapter: Chapter Six Departures from Reason: Ostrich Parasi Detected chapter: Chapter Seven How to Seek Truth: Nomological Netwo Detected chapter: Chapter Eight Call to Action Flattening CSS and remapping font sizes... Embedding font: Open Sans Source base font size is 12.00000pt Removing fake margins... Cleaning up manifest... Trimming unused files from manifest... Creating EPUB Output... 67% Running EPUB Output plugin Splitting markup on page breaks and flow limits, if any... Looking for large trees in e9781621579939/xhtml/preface.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch04.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_003.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch08.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/authorbio.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_007.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/dedication.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch03.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch07.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_002.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_006.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/copyright.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/title.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch02.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch06.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_001.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_005.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/index.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/praise.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch01.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ch05.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/ack.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_000.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_004.xhtml... No large trees found Looking for large trees in e9781621579939/xhtml/endnotes_split_008.xhtml... No large trees found EPUB output written to /home/calibre/out.epub Output saved to /home/calibre/out.epub |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,199
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The server and ebook-convert use the same code. Are you running the server using the same user account as ebook-convert?
|
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,192
Karma: 144286760
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You need to get the name of the font and not the filename of the font. The name of the font is the name given to the font in the font's metadata.
|
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to embed font while using ebook-convert cli | kaldan | Conversion | 3 | 04-27-2021 11:48 AM |
Embed font family option entry in preferences not sticking | Swifty4635 | Conversion | 15 | 04-28-2020 06:47 PM |
Automatically remove font-family on conversion? | Barty | Calibre | 9 | 04-04-2019 01:57 AM |
Epub conversion does not embed WOFF font | iliakan | Conversion | 6 | 02-06-2015 01:42 AM |