![]() |
#16 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 } Code:
@font-face { font-family: dejavu; font-style: normal; font-weight: normal; src: url(DejaVuSans_0_0.ttf) } 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. |
![]() |
![]() |
![]() |
#17 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
I just did that. http://calibre.kovidgoyal.net/ticket/2656
|
![]() |
![]() |
![]() |
#19 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#20 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The same as html2lrf that code hasn't changed.
|
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#22 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC, just the font family name.
|
![]() |
![]() |
![]() |
#23 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#24 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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()" |
![]() |
![]() |
![]() |
#25 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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) 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 |
![]() |
![]() |
![]() |
#26 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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')"
|
![]() |
![]() |
![]() |
#27 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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: []
|
![]() |
![]() |
![]() |
#28 |
Zealot
![]() ![]() 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 |
![]() |
![]() |
![]() |
#29 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
OK open a ticket and I'll look at it.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |