Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-18-2009, 08:47 AM   #16
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
@JSWolf

This is all nice and fine but involves manual labor. There is no way to do this just by using calibre.

For example I have a book in Serbian formatted as pure html. I cleaned it up with tidy making it fully standard compliant. Than I added this inside head tag:

Code:
<style type="text/css">
@font-face { font-family: dejavu; font-style: normal; font-weight: normal; src: url(DejaVuSans.ttf) }
body {font-family: dejavu,sans-serif} 
p    {font-family: dejavu,sans-serif} 
</style>

And placed font dejavu.ttf in the same folder as html. Opened it in Safari (one of the few browser to support font embedding) everything looks fine.
Start calibre (0.5.14) and import book.
Convert book to the epub and result does not show embedded font on the device nor on desktop Adobe DE.
Decompress the epub and verify css.

This is the generated css:

Code:
@font-face {
    font-family: dejavu;
    font-style: normal;
    font-weight: normal;
    src: url(resources/DejaVuSans_0_0.ttf)
    }
body {
    font-family: dejavu, sans-serif
    }
p {
    font-family: dejavu, sans-serif
    }
.calibre_class_1 {
    display: block;
    page-break-after: always
    }
However if I change the path to this:

Code:
@font-face {
    font-family: dejavu;
    font-style: normal;
    font-weight: normal;
    src: url(DejaVuSans_0_0.ttf)
    }
Than it starts working.

I hope this will be fixed in 0.6, but until that is done it is far from user frendly.

It is not just point that it can be done, but what matters also is that it is easy enough for everybody.
kiklop74 is offline   Reply With Quote
Old 06-18-2009, 08:52 AM   #17
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: 79,792
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I suggest opening a ticket on the Calibre website so this issue can be fixed.
JSWolf is offline   Reply With Quote
Advert
Old 06-18-2009, 09:14 AM   #18
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
I just did that. http://calibre.kovidgoyal.net/ticket/2656
kiklop74 is offline   Reply With Quote
Old 09-20-2009, 11:47 AM   #19
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
What exactly does ebook-convert expect in its --sans-family/--serif-family/--mono-family switches? I just couldn't find a format that works - font filename without path, font filename with path, font name as shown by Windows when the font is opened in control panel, font family. No matter what I do, the font does not get embedded. I even went as far as running the GUI (first time in half a year at least) to try font-embedding there, but even though I set up all font boxes (apparently font family is expected), the converted LRF wouldn't have any fonts embedded in it.
pepak is offline   Reply With Quote
Old 09-20-2009, 11:51 AM   #20
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The same as html2lrf that code hasn't changed.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-20-2009, 12:38 PM   #21
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
Well, what was the old format then? I never used embedding, since flashing the Reader was the preferable method, but this time I need to use embedded fonts for a change.
pepak is offline   Reply With Quote
Old 09-20-2009, 02:23 PM   #22
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC, just the font family name.
kovidgoyal is offline   Reply With Quote
Old 09-20-2009, 02:41 PM   #23
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
OK, that does not work. Can I use some debug switches or something to find out why? I don't know, maybe it requires admin rights or something, or maybe Calibre is looking in wrong directory, or something. It will probably be something so simple and obvious I will blush when I discover it, but at the moment, I am at a loss what to do.
pepak is offline   Reply With Quote
Old 09-20-2009, 03:08 PM   #24
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre uses the fontconfig library to find fonts. Here's how you can test to see if fontconfig is finding your fonts

calibre-debug -c "from calibre.utils.fonts import test; test()"
kovidgoyal is offline   Reply With Quote
Old 09-20-2009, 03:41 PM   #25
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
calibre-debug -c "from calibre.utils.fonts import test; test()"
Code:
[u'Arial',
 u'Courier New',
 u'Franklin Gothic Medium',
 u'Lucida Console',
 u'Lucida Sans',
 u'Lucida Sans Unicode',
 u'Marlett',
 u'Microsoft Sans Serif',
 u'Tahoma',
 u'Times New Roman',
 u'Trebuchet MS',
 u'Verdana',
 u'Wingdings']
{}
None
Pattern has 3 elts (size 16)
	family: "liberation serif"(s)
	slant: 100(i)(s)
	weight: 200(i)(s)
ebook-convert 1.txt 1.lrf --serif-family="Times New Roman"
Code:
1% Converting input to HTML...
InputFormatPlugin: TXT Input running on D:\Tmp\1.txt
InputFormatPlugin: HTML Input running on D:\Tmp\temp_calibre_txt_input_to_html.html
Language not specified
Creator not specified
Title not specified
Building file list...
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Creating LRF Output...
67% Creating LRF Output
Unable to find serif family Times New Roman
Processing u'temp_calibre_txt_input_to_html.html'
	Parsing HTML...
	Converting to BBeB...
LRF output written to D:\Tmp\1.lrf
Output saved to   D:\Tmp\1.lrf
pepak is offline   Reply With Quote
Old 09-20-2009, 05:23 PM   #26
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-debug -c "from calibre.utils.fonts import fontconfig, _fc; fontconfig.wait(); print _fc.files_for_family('Times New Roman')"
kovidgoyal is offline   Reply With Quote
Old 09-21-2009, 12:10 AM   #27
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
That returns just an empty pair of square brackets: []
pepak is offline   Reply With Quote
Old 09-21-2009, 03:46 AM   #28
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
I can confirm that running that snippet gives me a empty set of [] too. I'm using XP SP2 and Calibre 0.6.13.

Joop
JvdW is offline   Reply With Quote
Old 09-21-2009, 09:47 AM   #29
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
OK open a ticket and I'll look at it.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Difference Between ePUB and LRF? EatingPie Sony Reader 7 05-14-2010 05:32 PM
feed to lrf, how do I change font (or have default font) lovemov Calibre 3 03-16-2009 10:57 PM
Set default font for LRF? daruking Calibre 15 03-03-2009 06:26 PM
Changing lrf font size Oletros Sony Reader 11 03-19-2008 07:10 PM
LRF with embedded font igorsk Sony Reader 8 10-26-2006 08:08 AM


All times are GMT -4. The time now is 04:32 PM.


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