diff --git a/src/calibre/ebooks/epub/iterator.py b/src/calibre/ebooks/epub/iterator.py index 5601e9b8de..e953cbda51 100644 --- a/src/calibre/ebooks/epub/iterator.py +++ b/src/calibre/ebooks/epub/iterator.py @@ -98,7 +98,7 @@ class EbookIterator(object): url = re.compile(r'url\s*\([\'"]*(.+?)[\'"]*\)', re.DOTALL).search(block) if url: path = url.group(1).split('/') - path = os.path.join(os.path.dirname(item.path), *path) + path = os.path.join(os.path.dirname(item.path), *path) id = QFontDatabase.addApplicationFont(path) if id != -1: families = [unicode(f) for f in QFontDatabase.applicationFontFamilies(id)] @@ -106,6 +106,8 @@ class EbookIterator(object): family = family.group(1).strip().replace('"', '') if family not in families: print 'WARNING: Family aliasing not supported:', block + else: + print 'Loaded embedded font:', repr(family) def __enter__(self): self._tdir = TemporaryDirectory('_ebook_iter') diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index 01afcb08e2..ee7d7fa0b2 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -43,7 +43,7 @@ class KeyMapper(object): sign = -1 if size < base else 1 endp = 0 if size < base else 36 diff = (abs(base - size) * 3) + ((36 - size) / 100) - logb = abs(base - endp) + logb = abs(base - endp) result = sign * math.log(diff, logb) return result