diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index d478f47cea..8f5395b514 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -167,7 +167,7 @@ class ANDROID(USBMS): 'MB525', 'ANDROID2.3', 'SGH-I997', 'GT-I5800_CARD', 'MB612', 'GT-S5830_CARD', 'GT-S5570_CARD', 'MB870', 'MID7015A', 'ALPANDIGITAL', 'ANDROID_MID', 'VTAB1008', 'EMX51_BBG_ANDROI', - 'UMS', '.K080', 'P990', 'LTE', 'MB853'] + 'UMS', '.K080', 'P990', 'LTE', 'MB853', 'GT-S5660_CARD'] WINDOWS_CARD_A_MEM = ['ANDROID_PHONE', 'GT-I9000_CARD', 'SGH-I897', 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID', 'GT-P1000_CARD', 'A70S', 'A101IT', '7', 'INCREDIBLE', 'A7EB', 'SGH-T849_CARD', diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index adef0f1bfb..20be750925 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -539,7 +539,8 @@ class Style(object): 'Return value in pts' if base is None: base = self.width - font = font or self.fontSize + if not font and font != 0: + font = self.fontSize return unit_convert(value, base, font, self._profile.dpi) def pt_to_px(self, value): diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index ba90a31632..489498d90c 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -283,7 +283,10 @@ class CSSFlattener(object): psize = fsize elif 'font-size' in cssdict or tag == 'body': fsize = self.fmap[font_size] - cssdict['font-size'] = "%0.5fem" % (fsize / psize) + try: + cssdict['font-size'] = "%0.5fem" % (fsize / psize) + except ZeroDivisionError: + cssdict['font-size'] = '%.1fpt'%fsize psize = fsize try: