writing-mode properties are deleted during conversions

Bug #1862447 reported by No Thanks
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
New
Undecided
Unassigned

Bug Description

This is a fairly common issue when converting Japanese (and presumably Chinese) eBooks using Calibre. This causes books to be displayed horizontally and left to right like a standard English book when it is supposed to be displayed vertically and right to left.

I have been able to reproduce this with several books both converting from azw3 to epub and from epub to azw3. From looking at the stylesheets of the books I've been converting it appears that it is standard for Japanese books to include CSS along the lines of:

.hltr {
  -webkit-writing-mode: horizontal-tb;
  -epub-writing-mode: horizontal-tb;
}
.vrtl {
  -webkit-writing-mode: vertical-rl;
  -epub-writing-mode: vertical-rl;
}

Sometimes they are more comprehensive and include more potential writing-mode properties such as:

.hltr {
  writing-mode: horizontal-tb;
  -webkit-writing-mode: horizontal-tb;
  -moz-writing-mode: horizontal-tb;
  -ms-writing-mode: horizontal-tb;
  -o-writing-mode: horizontal-tb;
  -epub-writing-mode: horizontal-tb;
}
.vrtl {
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  -moz-writing-mode: vertical-rl;
  -ms-writing-mode: vertical-rl;
  -o-writing-mode: vertical-rl;
  -epub-writing-mode: vertical-rl;
}

From my experience "-webkit-writing-mode" is the most relevant/current and works with the Calibre Viewer, Kobo Aura One and Kindle Paperwhite 3 but I haven't been able to have any of the writing-mode properties remain in an output file as of yet. In the job details of a conversion from epub to azw3 I noticed this which seems relevant

Parsing item/style/style-standard.css ...
Property: Unknown Property name. [70:5: -webkit-writing-mode]
Property: Unknown Property name. [71:5: -epub-writing-mode]
Property: Unknown Property name. [75:5: -webkit-writing-mode]
Property: Unknown Property name. [76:5: -epub-writing-mode]

The same thing appeared when converting a different book from azw3 to epub. I know that the absence of this property (-webkit-writing-mode: vertical-rl) is the culprit as editing the output files to include it completely fixes the issue and it makes the books display as they are supposed to.

I will provide the job details log and the input/output file of the book I have tested the most but to be clear this isn't an isolated issue. To the best of my knowledge this affects any book with vertical right to left text and I have seen multiple other people have this same problem.

Calibre Version: 4.10.1 (64bit)
Operating System: Windows 10

Job Details:

Convert book 1 of 1 (STEINS;GATE 蝶翼のダイバージェンス:Reverse)
Conversion options changed from defaults:
  verbose: 2
  cover: u'C:\\Users\\KLEPTO~1\\AppData\\Local\\Temp\\calibre_3syf5m\\477ogp.jpeg'
  debug_pipeline: u'D:\\Documents\\asdkjfhaskjl'
  no_inline_toc: True
  read_metadata_from_opf: u'C:\\Users\\KLEPTO~1\\AppData\\Local\\Temp\\calibre_3syf5m\\edvsto.opf'
  output_profile: u'generic_eink_hd'
Resolved conversion options
calibre version: 4.10.1
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'C:\\Users\\KLEPTO~1\\AppData\\Local\\Temp\\calibre_3syf5m\\477ogp.jpeg',
 'debug_pipeline': u'D:\\Documents\\asdkjfhaskjl',
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_compress': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': u'',
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x00000267EA16A648>,
 'insert_blank_line': False,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'mobi_toc_at_start': False,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'no_inline_toc': True,
 'output_profile': <calibre.customize.profiles.GenericEinkHD object at 0x00000267EA169348>,
 'page_breaks_before': u'/',
 'prefer_author_sort': False,
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'C:\\Users\\KLEPTO~1\\AppData\\Local\\Temp\\calibre_3syf5m\\edvsto.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'search_replace': '[]',
 'series': None,
 'series_index': None,
 'share_not_sync': False,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'start_reading_at': None,
 'subset_embedded_fonts': False,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'toc_title': None,
 'transform_css_rules': '[]',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: EPUB Input running
on C:\Users\KLEPTO~1\AppData\Local\Temp\calibre_3syf5m\8buz6a.epub
Input debug saved to: D:\Documents\asdkjfhaskjl\input
Parsing all content...
Parsing item/xhtml/p-004.xhtml ...
Parsing item/navigation-documents.xhtml ...
Parsing item/style/style-advance.css ...
Parsing item/style/book-style.css ...
Parsing item/style/style-reset.css ...
Property: Unknown Property name. [28:5: word-wrap]
Property: Unknown Property name. [30:5: -webkit-text-align-last]
Property: Unknown Property name. [31:5: -epub-text-align-last]
Property: Unknown Property name. [32:5: -webkit-line-break]
Property: Unknown Property name. [33:5: -epub-line-break]
Property: Unknown Property name. [34:5: -webkit-word-break]
Property: Unknown Property name. [35:5: -epub-word-break]
Property: Unknown Property name. [36:5: -webkit-hyphens]
Property: Unknown Property name. [37:5: -epub-hyphens]
Parsing item/style/style-standard.css ...
Property: Unknown Property name. [70:5: -webkit-writing-mode]
Property: Unknown Property name. [71:5: -epub-writing-mode]
Property: Unknown Property name. [75:5: -webkit-writing-mode]
Property: Unknown Property name. [76:5: -epub-writing-mode]
Property: Unknown Property name. [136:5: -webkit-text-align-last]
Property: Unknown Property name. [137:5: -epub-text-align-last]
Property: Unknown Property name. [142:5: -webkit-text-align-last]
Property: Unknown Property name. [143:5: -epub-text-align-last]
Property: Unknown Property name. [148:5: -webkit-text-align-last]
Property: Unknown Property name. [149:5: -epub-text-align-last]
Property: Unknown Property name. [154:5: -webkit-text-align-last]
Property: Unknown Property name. [155:5: -epub-text-align-last]
Property: Unknown Property name. [300:5: -webkit-text-combine]
Property: Unknown Property name. [301:5: -epub-text-combine]
Property: Unknown Property name. [308:5: -webkit-text-combine]
Property: Unknown Property name. [309:5: -epub-text-combine]
Property: Unknown Property name. [312:5: -webkit-text-orientation]
Property: Unknown Property name. [313:5: -epub-text-orientation]
Property: Unknown Property name. [316:5: -webkit-text-orientation]
Property: Unknown Property name. [317:5: -epub-text-orientation]
Property: Unknown Property name. [318:5: -epub-text-orientation]
Property: Unknown Property name. [367:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [368:5: -epub-text-emphasis-style]
Property: Unknown Property name. [371:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [372:5: -epub-text-emphasis-style]
Property: Unknown Property name. [375:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [376:5: -epub-text-emphasis-style]
Property: Unknown Property name. [379:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [380:5: -epub-text-emphasis-style]
Property: Unknown Property name. [383:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [384:5: -epub-text-emphasis-style]
Property: Unknown Property name. [387:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [388:5: -epub-text-emphasis-style]
Property: Unknown Property name. [391:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [392:5: -epub-text-emphasis-style]
Property: Unknown Property name. [395:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [396:5: -epub-text-emphasis-style]
Property: Unknown Property name. [399:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [400:5: -epub-text-emphasis-style]
Property: Unknown Property name. [403:5: -webkit-text-emphasis-style]
Property: Unknown Property name. [404:5: -epub-text-emphasis-style]
Property: Unknown Property name. [800:5: -webkit-text-emphasis-color]
Property: Unknown Property name. [801:5: -epub-text-emphasis-color]
Property: Unknown Property name. [839:5: -webkit-text-underline-position]
Property: Unknown Property name. [3078:5: -webkit-line-break]
Property: Unknown Property name. [3079:5: -epub-line-break]
Property: Unknown Property name. [3082:5: -webkit-line-break]
Property: Unknown Property name. [3083:5: -epub-line-break]
Property: Unknown Property name. [3086:5: -webkit-line-break]
Property: Unknown Property name. [3087:5: -epub-line-break]
Property: Unknown Property name. [3090:5: -webkit-line-break]
Property: Unknown Property name. [3091:5: -epub-line-break]
Property: Unknown Property name. [3096:5: -webkit-word-break]
Property: Unknown Property name. [3097:5: -epub-word-break]
Property: Unknown Property name. [3100:5: -webkit-word-break]
Property: Unknown Property name. [3101:5: -epub-word-break]
Property: Unknown Property name. [3104:5: -webkit-word-break]
Property: Unknown Property name. [3105:5: -epub-word-break]
Property: Unknown Property name. [3110:5: word-wrap]
Property: Unknown Property name. [3113:5: word-wrap]
Property: Unknown Property name. [99:5: -webkit-text-underline-position]
Parsing item/style/style-kadokawa.css ...
Property: Unknown Property name. [25:5: -webkit-text-underline-position]
Parsing item/style/style-check.css ...
Parsing item/xhtml/p-colophon.xhtml ...
Parsing item/xhtml/p-fmatter-003.xhtml ...
Parsing item/xhtml/p-fmatter-001.xhtml ...
Parsing item/xhtml/p-fmatter-002.xhtml ...
Parsing item/xhtml/p-009.xhtml ...
Parsing item/xhtml/p-006.xhtml ...
Parsing item/xhtml/p-010.xhtml ...
Parsing item/xhtml/p-012.xhtml ...
Parsing item/xhtml/p-titlepage.xhtml ...
Parsing item/xhtml/p-bookwalker.xhtml ...
Parsing item/xhtml/p-011.xhtml ...
Parsing item/xhtml/p-007.xhtml ...
Parsing item/xhtml/p-toc-001.xhtml ...
Parsing item/xhtml/p-001.xhtml ...
Parsing item/xhtml/p-002.xhtml ...
Parsing item/xhtml/p-cover.xhtml ...
Parsing item/xhtml/p-005.xhtml ...
Parsing item/xhtml/p-caution.xhtml ...
Parsing item/xhtml/p-003.xhtml ...
Parsing item/xhtml/p-008.xhtml ...
Reading TOC from NCX...
Parsed HTML written to: D:\Documents\asdkjfhaskjl\parsed
Merging user specified metadata...
Detecting structure...
Structured HTML written to: D:\Documents\asdkjfhaskjl\structure
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 20 items of level: p_4
Found 3435 items of level: p_2
Found 89 items of level: p_3
Found 20 items of level: div_3
Found 38 items of level: div_2
Found 21 items of level: div_1
Ignoring level p_4
Ignoring level div_3
p_2 left margin stats: Counter({u'0': 3435})
p_2 right margin stats: Counter({u'0': 3435})
p_3 left margin stats: Counter({u'0': 89})
p_3 right margin stats: Counter({u'0': 89})
div_2 left margin stats: Counter({u'0': 13})
div_2 right margin stats: Counter({u'0': 13})
div_1 left margin stats: Counter({u'0': 9, u'auto': 2})
div_1 right margin stats: Counter({u'0': 9, u'auto': 2})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'item/navigation-documents.xhtml' from manifest
Trimming u'item/toc.ncx' from manifest
Trimming u'item/js/kobo.js' from manifest
Processed HTML written to: D:\Documents\asdkjfhaskjl\processed
Creating AZW3 Output...
Serializing resources...
Splitting markup on page breaks and flow limits, if any...
Creating KF8 output
 Generating KF8 markup...
 Compressing markup...
 Creating indices...
AZW3 output written to C:\Users\KLEPTO~1\AppData\Local\Temp\calibre_3syf5m\lme6ko.azw3

Revision history for this message
No Thanks (verycooldude) wrote :
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.