Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-05-2021, 03:35 PM   #1
edgargal
Member
edgargal began at the beginning.
 
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
2. In calibre content server with web browser > Book > Convert this book to another format > Look & feel > Embed font family: 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.
edgargal is offline   Reply With Quote
Old 05-05-2021, 09:38 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: 43,920
Karma: 22669818
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 05-06-2021, 07:53 AM   #3
edgargal
Member
edgargal began at the beginning.
 
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
edgargal is offline   Reply With Quote
Old 05-06-2021, 08:50 AM   #4
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: 43,920
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No clue, sorry. Have you restarted the server since installing the fonts?
kovidgoyal is offline   Reply With Quote
Old 05-06-2021, 10:11 AM   #5
edgargal
Member
edgargal began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
Quote:
Originally Posted by kovidgoyal View Post
No clue, sorry. Have you restarted the server since installing the fonts?
No, but I did now and got the same error. Maybe bug?
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.
edgargal is offline   Reply With Quote
Advert
Old 05-06-2021, 10:33 AM   #6
edgargal
Member
edgargal began at the beginning.
 
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
edgargal is offline   Reply With Quote
Old 05-06-2021, 10:43 AM   #7
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: 43,920
Karma: 22669818
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?
kovidgoyal is offline   Reply With Quote
Old 05-06-2021, 10:56 AM   #8
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: 74,306
Karma: 129333566
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.
JSWolf is online now   Reply With Quote
Old 05-06-2021, 12:07 PM   #9
edgargal
Member
edgargal began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Mar 2021
Device: none
Quote:
Originally Posted by kovidgoyal View Post
The server and ebook-convert use the same code. Are you running the server using the same user account as ebook-convert?
Thank you I had a bad startup script.

Code:
[Install]
#WantedBy=multi-user.target #changed this for
WantedBy=user.target
edgargal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:22 AM.


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