renaming incorrectly named fonts fails

Bug #1363028 reported by Lee MacKinnell on 2014-08-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

stylesheet.css
The font family name specified in the CSS @font-face rule: "Arial_avs_space_Narrow" does not match the font name inside the actual font file: "Arial Narrow". This can cause problems in some viewers. You should change the CSS font name to match the actual font name.
Change the font name Arial_avs_space_Narrow to Arial Narrow everywhere

clicking the above link causes the following error

calibre, version 2.1.0
ERROR: Unhandled exception: <b>TypeError</b>:expected string or buffer

calibre 2.1 isfrozen: True is64bit: True
Linux-3.13.0-34-generic-x86_64-with-debian-jessie-sid Linux ('64bit', 'ELF')
('Linux', '3.13.0-34-generic', '#60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014')
Python 2.7.8
Linux: ('debian', 'jessie/sid', '')
Successfully initialized third party plugins: Goodreads && Beam Ebooks && Generate Cover && Open With && Quality Check && Find Duplicates && KindleUnpack - The Plugin && Barnes & Noble && Kobo Utilities && Fantastic Fiction && Fantastic Fiction Adults && Modify ePub && Manage Series && FictionDB
Traceback (most recent call last):
  File "site-packages/calibre/gui2/tweak_book/boss.py", line 62, in ans
  File "site-packages/calibre/gui2/tweak_book/boss.py", line 1066, in fix_requested
  File "site-packages/calibre/gui2/tweak_book/check.py", line 222, in fix_errors
  File "site-packages/calibre/ebooks/oeb/polish/check/main.py", line 101, in fix_errors
  File "site-packages/calibre/ebooks/oeb/polish/check/fonts.py", line 78, in __call__
  File "site-packages/calibre/ebooks/oeb/polish/container.py", line 494, in parse_css
  File "site-packages/calibre/ebooks/oeb/polish/utils.py", line 171, in parse_css
  File "site-packages/cssutils/parse.py", line 148, in parseString
  File "site-packages/cssutils/css/cssstylesheet.py", line 355, in _setCssTextWithEncodingOverride
  File "site-packages/cssutils/css/cssstylesheet.py", line 303, in _setCssText
  File "site-packages/cssutils/util.py", line 461, in _parse
  File "site-packages/cssutils/tokenize2.py", line 123, in tokenize
TypeError: expected string or buffer

note there is also a similar bug when running the modify epub plugin when selecting "strip cobo DRM elements" or "strip spans" i am guessing the plugin relies on the same base functionality

Lee MacKinnell (aussiefeld) wrote :

same bug is in 2.0 but not in the build before 2.0

affects: calibre (Ubuntu) → calibre

That error indicates one of the CSS files in that book is
corrupted/empty. Try running the Check Book tool that should point you
to the problem. Once you fix it, replace fonts will work.

 status invalid

Changed in calibre:
status: New → Invalid
Lee MacKinnell (aussiefeld) wrote :

not a CSS issue as the only errors after running check book for the epub is the one relating to the font
here is a sample file to show the issue

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
Lee MacKinnell (aussiefeld) wrote :

thank you!
when i saw the issue in 2.0 i figured it might have been missed during the major upgrade (or caused during the upgrade) but when it was in 2.1 that's when i thought you should know

thanks again

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers