This commit is contained in:
Kovid Goyal 2009-02-22 08:18:17 -08:00
parent 376aac607d
commit 4706660425
2 changed files with 4 additions and 2 deletions

View File

@ -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')

View File

@ -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