11-14-2016, 05:21 AM | #31 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
I am impressed. Just run the editor from source with my sample docx for generating a new epub. Works very well
Can you do the same behavior for an existing epub for updating? E.g if you are looking for the file I gave you (FonttestwithoutembededFont.epub). If you embed the font it find the regular one and for the light version it found 2 possible matches based on weight. But only one is correct because there is only one as light regular. The other one is light italic and that one isn't used for this epub. Guess, if you are able to get that in line too, most users are happy with the new solution. Best regards, DD |
11-14-2016, 05:58 AM | #32 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
While in this case it is easy to deduce which is the correct font, in the general case it is not so easy. Remember that there are four axes on which font properties must be matched, so the search space is rather large and you can have many candidates. As such, I think showing the user the candidates and letting them pick manually is better than auto-picking one, which could very well be wrong. Not to mention that this problem only happens for special purpose fonts i.e. ones that do not have regular weight or stretch properties, which is relative rare.
|
Advert | |
|
11-14-2016, 06:56 AM | #33 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Understand. Thanks.
|
11-14-2016, 04:00 PM | #34 | ||
Evangelist
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
I jumped hard because it's one of those very much not intuitive UI things that the programmer thinks is really easy to use, but other users don't. And, it could be made much, much easier if the user could just click a font file in the "not quite matching" list and say "OK, that's the one I meant...embed that, and make sure the @font-face definition that gets created matches the selector you found, thanks". This would also make it do what users seem to expect it will do. Quote:
Code:
.something { font-family: "Adobe Garamond Pro"; font-weight: bold; } For weight, this makes perfect sense, because even the CSS spec says that font-weight can never fail to match, as long as there is a font with a name match that has the appropriate glyphs (and I never expect Calibre to check this) and otherwise matches (italic, etc.). So, yeah, I read the spec...and Calibre's editor (which is acting as a UA at that point) doesn't follow it when embedding. |
||
11-14-2016, 10:15 PM | #35 | |||||
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
Advert | |
|
11-15-2016, 12:06 AM | #36 | |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
https://github.com/kovidgoyal/calibr...0ccadbac0a03bb This is going to need some testing. |
|
11-15-2016, 01:27 AM | #37 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Good morning. I see, you are busy working on this again
|
11-15-2016, 07:28 AM | #38 | |
Connoisseur
Posts: 89
Karma: 190508
Join Date: May 2014
Device: Android
|
Quote:
Happy to be your guinea pig. Tell me how you think it's best stressed, and I'm happy to inform you when and if I break it. Thanks for taking the time to do this. |
|
11-15-2016, 07:59 AM | #39 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
It works much better now. If you run the editor from actual source you will see the improvements immediately.
|
11-15-2016, 09:49 AM | #40 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just use it and let me know if it does something unexpected
|
11-16-2016, 12:00 PM | #41 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Hi Kovid,
I finish my tests and all went good so fare. I recognize some system usage increase during the time the algorithm is analyzing the document. An other observation was, that if a document have already a font included the algorithm seems not to check wether the font is in use ore not. In my case there was already a font (Arial Unicode) integrated but not used. The algorithm pick up the correct one's on top but don't delete the already included wrong one. In my case this behavior is ok (I think) because the document uses parts of the huge Arial Unicode font (instead of the original font). The algorithm was maybe not able to find the better one. I guess this will be a unsolvable situation as the system can't know at that point what the right font is if there are intersections in glyphs between used fonts. I recognize this behavior after I generate my mentioned "worse case book" with updated sources from scratch today. I was wondering why there was missing some fonts and surprised about to see that most of exotic glyphs matching better and with less missing ones as before. Maybe you can put an additional remark into help file / tool tip that this can happen. I found a little issue with one font. calibre wasn't able to find the font code2001 with font style italic. I never had seen a own italic version. After I check the font, I recognize the italic glyphs are included within the font. No problem at all, I delete the odd one manually. Best regards, DD |
11-16-2016, 12:06 PM | #42 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Embedding fonts will never delete any pre-existing embedded fonts. It should not re-embed an already embedded font, as long as the font family and font styles of the already embedded font match those of the newly embedded font, the old font will be used. But if the old font has a different family/style/weight/stretch in its @font-face rule then then it will not be re-used.
|
11-17-2016, 01:20 PM | #43 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Stupid question, if I may? (I've been playing with your editor. Very nice.) Does the import function (or any of these others--I freely admit I have not played with this yet) check the embedding permissions for the font, prior to embedding it or displaying it for use (in the new function)? Thanks, Hitch |
|
11-18-2016, 12:49 AM | #44 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, calibre is not going to get into the game of trying to second guess the user about their intentions. If the user asks calibre to embed a font, calibre will embed the font. It is up to the user to ensure they have the proper permissions for the intended use of the fonts.
|
11-18-2016, 03:03 AM | #45 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Thanks. I wasn't looking to turn this into a philosophical discussion, about licensing fonts rather than not--I really just wanted to know if it did (look for the embedding bits). Obviously, it's something that we're very attuned to, at my shop. I was wondering if C did look for that, because we do get a fair number of "fixer-uppers." If C looked at that, I could have used it as a quick-n-dirty double-check of ePUBs that we've not made ourselves. As it is, we unzip the ePUB and I check the bits with my font manager. I was simply hoping that you might have something faster/easier. Thanks. Hitch |
|
|
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 |