Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 01-19-2020, 01:36 AM   #736
thetyrantcbass
Junior Member
thetyrantcbass began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2018
Device: Kindle Oasis (2017)
Thanks very much for your work!
thetyrantcbass is offline   Reply With Quote
Old 01-22-2020, 10:13 AM   #737
AlaVander
Junior Member
AlaVander began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: none
Thanks very much!But the latest version has some problems.
<br/> are not corresponding to line spacing, but paragraph spacing.
The previous version did not have this problem.
AlaVander is offline   Reply With Quote
Advert
Old 01-22-2020, 11:51 AM   #738
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,363
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by AlaVander View Post
Thanks very much!But the latest version has some problems.
<br/> are not corresponding to line spacing, but paragraph spacing.
The previous version did not have this problem.
It works properly in the cases I have tried.

You will need to provide an example that demonstrates the problem if you want me to look into it further.
jhowell is online now   Reply With Quote
Old 02-03-2020, 11:24 PM   #739
Argon
Enthusiast
Argon began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kindle Oasis 3
Does this support multi-level table of contents entries? I modified an ePub to have sometimes four total levels deep in Calibre, which seemed to work, but the conversion only preserved the top- and second-level links, with deeper entries apparently missing. Not a huge deal, but curious if this is a known limitation of the format or Kindles or your plugin.
Argon is offline   Reply With Quote
Old 02-04-2020, 08:36 AM   #740
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,363
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by Argon View Post
Does this support multi-level table of contents entries? I modified an ePub to have sometimes four total levels deep in Calibre, which seemed to work, but the conversion only preserved the top- and second-level links, with deeper entries apparently missing. Not a huge deal, but curious if this is a known limitation of the format or Kindles or your plugin.
All of the logical TOC levels are retained during conversion. E-ink Kindle devices, such as your Oasis, display only the first two levels.
jhowell is online now   Reply With Quote
Advert
Old 02-04-2020, 11:59 AM   #741
Argon
Enthusiast
Argon began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kindle Oasis 3
Quote:
Originally Posted by jhowell View Post
All of the logical TOC levels are retained during conversion. E-ink Kindle devices, such as your Oasis, display only the first two levels.
Bummer. Thanks for the reply.
Argon is offline   Reply With Quote
Old 02-05-2020, 11:30 PM   #742
AlaVander
Junior Member
AlaVander began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: none
Thanks for the reply.After testing, this is due to some errors in the epub style rather than the plugin.
AlaVander is offline   Reply With Quote
Old 02-06-2020, 01:46 AM   #743
AlaVander
Junior Member
AlaVander began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: none
Besides, what's wrong with this error?

calibre, version 4.9.0
KFX conversion failed: <p><b>Cannot convert shuyi</b><br><br><b>KFX creation error:</b> Unexpected Ion symbols used: $73</p>



calibre, version 4.9.0
error: KFX conversion failed: <p><b>Cannot convert shuyi</b><br><br><b>KFX creation error:</b> Unexpected Ion symbols used: $73</p>
AlaVander is offline   Reply With Quote
Old 02-06-2020, 10:41 AM   #744
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,363
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by AlaVander View Post
Besides, what's wrong with this error?

calibre, version 4.9.0
KFX conversion failed: <p><b>Cannot convert shuyi</b><br><br><b>KFX creation error:</b> Unexpected Ion symbols used: $73</p>
That error is caused by the book you are converting producing KFX output that I had not seen previously. I was able to determine that this particular KFX content can result from converting books containing the "background-clip" property.

I will fix this error in the next plugin release, which should be within a week from now. If you need to convert that book sooner you should be able to do so by eliminating that property from the book using the calibre editor.
jhowell is online now   Reply With Quote
Old 02-06-2020, 11:39 PM   #745
AlaVander
Junior Member
AlaVander began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: none
Quote:
Originally Posted by jhowell View Post
That error is caused by the book you are converting producing KFX output that I had not seen previously. I was able to determine that this particular KFX content can result from converting books containing the "background-clip" property.

I will fix this error in the next plugin release, which should be within a week from now. If you need to convert that book sooner you should be able to do so by eliminating that property from the book using the calibre editor.
When I eliminated that property from the book, the plugin works.Looking forward to a new version.
AlaVander is offline   Reply With Quote
Old 02-07-2020, 02:02 AM   #746
AlaVander
Junior Member
AlaVander began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: none
When I eliminated that property from the book, the plugin works.Looking forward to a new version.
AlaVander is offline   Reply With Quote
Old 02-07-2020, 07:39 AM   #747
wzyboy
Junior Member
wzyboy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Sep 2012
Device: Kindle Keyboard 3G, Kindle Paperwhite [1-4]
Workaround for vertical text and ruby

Hi, I would like to share a workaround from my friend, to deal with books with vertical text and/or ruby tags.

Japanese (ja) and Traditional Chinese (zh, zh-tw) books are printed vertically. They also sometimes use special HTML tags called "ruby": https://developer.mozilla.org/en-US/...L/Element/ruby

However, for some reason, Kindle Previewer only supports vertical text and ruby tags for Japanese (dc:language=ja) books. If you feed a Chinese book (dc:language=zh or dc:language=zh-tw) with vertical text to Kindle Previewer, it will simply reject it with error message: https://www.mobileread.com/forums/sh...&postcount=456

For ruby tags, Kindle Previewer fails silently if the book does not have dc:language=ja set.

Strangely, the requirement of dc:language=ja only exists in Kindle Previewer. A Chinese ePub book with vertical text and ruby tags could be converted to KF8 (.azw3) without any issues with KindleGen.

So, to support vertifical text and ruby tags in KFX, one should set xml:lang=ja even for non-Japanese books:

Code:
--- a/previewer_prep_epub.py	2020-01-18 07:55:20.000000000 +0000
+++ b/previewer_prep_epub.py	2020-02-07 02:14:33.000000000 +0000
@@ -406,6 +406,11 @@
                         lang.text = "en"
                         fixed = True
 
+                    if lang.text.lower().partition(" ")[0] in ["zh", "zh-tw"]:
+                        self.log.info("Changed EPUB language from '%s' to 'ja'" % lang.text)
+                        lang.text = "ja"
+                        fixed = True
+
                     if FIX_LANGUAGE_SUFFIX and "-" not in lang.text:
                         current_language_pattern = re.compile(re.escape(lang.text) + "(-.+)?$", re.IGNORECASE)
                         best_language_variant, best_language_count = lang.text, 0
This hack, however, will result Japanese fonts to be used for non-Japanese books. A custom font should be used to remedy this.

Could we consider add this hack (but maybe not enabled by default) to the KFX output plugin?



BTW, calibre currently does not recognize -webkit-writing-mode and -epub-writing-mode and strips these CSS during conversion. So one must use calibre-debug to run KFX Output, instead of using calibre GUI.

I have attached a sample Chinese ePub file with vertical text and ruby. After setting the language to "ja" in KFX Output plugin, it could be rendered without issues on Kindle Paperwhite 4.
Attached Thumbnails
Click image for larger version

Name:	screenshot_2020_02_06T17_15_16-0801.png
Views:	12
Size:	15.6 KB
ID:	176984  
Attached Files
File Type: epub vertical-text-with-ruby.epub (2.1 KB, 6 views)
wzyboy is offline   Reply With Quote
Old 02-07-2020, 02:59 PM   #748
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,363
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by wzyboy View Post
Hi, I would like to share a workaround from my friend, to deal with books with vertical text and/or ruby tags.
...
Strangely, the requirement of dc:language=ja only exists in Kindle Previewer. A Chinese ePub book with vertical text and ruby tags could be converted to KF8 (.azw3) without any issues with KindleGen.
I am curious regarding your interest in converting vertical Chinese books to KFX format. Why not just use KF8? Is there something that the KF8 renderer does not handle properly or that the KFX renderer does better?


Quote:
Originally Posted by wzyboy View Post
So, to support vertifical text and ruby tags in KFX, one should set xml:lang=ja even for non-Japanese books

This hack, however, will result Japanese fonts to be used for non-Japanese books. A custom font should be used to remedy this.

Could we consider add this hack (but maybe not enabled by default) to the KFX output plugin?
I will add an experimental feature to convert vertical Chinese language books in the next KFX Output plugin release.

You will need to add <meta name="primary-writing-mode" content="vertical-rl"/> to the <metadata> section of the OPF to enable vertical text conversion. This is proprietary Amazon Kindle metadata and should be safe to add as it should be ignored by anything else.

When this is present the plugin will change the Chinese language code to Japanese for conversion and then will change it back within the KFX file produced. Doing that will allow conversion to succeed with vertical text and should also allow Chinese font selection in the resulting file.


Quote:
Originally Posted by wzyboy View Post
BTW, calibre currently does not recognize -webkit-writing-mode and -epub-writing-mode and strips these CSS during conversion. So one must use calibre-debug to run KFX Output, instead of using calibre GUI.
...
I have attached a sample Chinese ePub file with vertical text and ruby.
In your example you are applying the class "vrtl" to the <html> element. It seems that calibre does not handle this properly, resulting the the class styling being lost during conversion. I have reported it as a bug to the calibre developer.

In the mean time you can work around the problem by moving the class to the <body> element instead.

Quote:
Originally Posted by wzyboy View Post
After setting the language to "ja" in KFX Output plugin, it could be rendered without issues on Kindle Paperwhite 4.
The roll out of vertical Japanese in KFX is not yet complete. The Kindle for Android and iOS apps support ruby, but the current e-ink Kindle firmware (5.12.3) uses an older version of the KFX renderer which may still have bugs in ruby support.
jhowell is online now   Reply With Quote
Old 02-07-2020, 06:56 PM   #749
wzyboy
Junior Member
wzyboy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Sep 2012
Device: Kindle Keyboard 3G, Kindle Paperwhite [1-4]
Quote:
Originally Posted by jhowell View Post
I am curious regarding your interest in converting vertical Chinese books to KFX format. Why not just use KF8? Is there something that the KF8 renderer does not handle properly or that the KFX renderer does better?
Indeed, the KF8 format has decent support for vertical text and ruby tags. However, Kindle only supports Page Flip (the feature that you see thumbnails of nine pages at the same time) for KFX files, which is useful for voluminous books. That's why I would like to convert my ePub books to KFX instead of KF8.


Quote:
I will add an experimental feature to convert vertical Chinese language books in the next KFX Output plugin release.

You will need to add <meta name="primary-writing-mode" content="vertical-rl"/> to the <metadata> section of the OPF to enable vertical text conversion. This is proprietary Amazon Kindle metadata and should be safe to add as it should be ignored by anything else.
Thank you for adding such a feature. After some fiddling around with the OPF file, we discovered that it is <spine page-progression-direction="rtl"> that requires lang=ja. If Kindle Previewer sees page-progrssion-direction=rtl, it will forcefully set primary-writing-mode=vertical, and primary-writing-mode=veritical requires lang=ja.

So maybe we could detect the value of page-progression-direction and decide whether the plugin should patch the language code. Or we could just add a function switch and let the user decide if they want this hack.


Quote:
When this is present the plugin will change the Chinese language code to Japanese for conversion and then will change it back within the KFX file produced. Doing that will allow conversion to succeed with vertical text and should also allow Chinese font selection in the resulting file.
Glad to know it is possible to change the language code back after the processing of Kindle Previewer!


Quote:
In your example you are applying the class "vrtl" to the <html> element. It seems that calibre does not handle this properly, resulting the the class styling being lost during conversion. I have reported it as a bug to the calibre developer.

In the mean time you can work around the problem by moving the class to the <body> element instead.
Thank you for reporting the bug to the author of calibre and the workaround!
wzyboy is offline   Reply With Quote
Old 02-12-2020, 06:38 PM   #750
NandorHUN
Junior Member
NandorHUN began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2020
Device: Kindle Oasis 2 32 Gb 3G + Wifi
Languages with KFX?

Hi Guys!

Is Hungarian language somehow supported by kfx?
I heard this is the best format, but my books are Hungarian (it's language that use the same arabic latters as English German etc... except it has letters like "á é ő ű ü ö ó" too.).

Thanks in advance.
NandorHUN is offline   Reply With Quote
Reply

Tags
kfx, linux, wine

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Output] KePub Output Plugin jgoguen Plugins 324 02-02-2020 05:01 AM
Conversion output plugins? jgoguen Development 14 08-10-2013 12:19 PM
Output file name after conversion dbellefuil Calibre 2 06-14-2013 05:40 PM
catalogue builder output columns are not in the same order in the output KWhytte Library Management 5 12-04-2012 03:03 AM
Conversion output folders TechieLady Conversion 6 01-19-2012 03:49 AM


All times are GMT -4. The time now is 03:04 PM.


MobileRead.com is a privately owned, operated and funded community.