ThanatosDi / EpubConv_Python

Use python convert epub file from Simplified Chinese to Traditional Chinese on windows
Apache License 2.0
90 stars 15 forks source link

加入直排功能 #4

Closed PoJenHsueh closed 5 years ago

PoJenHsueh commented 6 years ago

Hi, Mr. Ku:

Thanks for your kindness and effort that you develop a nice good program. Would you consider to add the vertical feature (直排) and it will help me a lots?

It seem that there are some files need to modify to support this feature. Currently, I only could do it manually.

(1) Modify the *.css under Styles folder and add/modify html for vertical feature html { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -epub-writing-mode: vertical-rl; } (2) Modify the content.opf

(i) update language into zh-TW

zh-TW (ii) add the page-progression-direction="rtl" in the " spine " "<" spine aaa="xxx" page-progression-direction="rtl" ">" Have a good day. Regards, PoJen
ThanatosDi commented 5 years ago

OK, I got it. When I have free time, I will as soon as to add this feature.

ThanatosDi commented 5 years ago

Hi, Mr. Ku:

Thanks for your kindness and effort that you develop a nice good program. Would you consider to add the vertical feature (直排) and it will help me a lots?

It seem that there are some files need to modify to support this feature. Currently, I only could do it manually.

(1) Modify the *.css under Styles folder and add/modify html for vertical feature html { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -epub-writing-mode: vertical-rl; } (2) Modify the content.opf

(i) update language into zh-TW dc:languagezh-TW</dc:language> (ii) add the page-progression-direction="rtl" in the " spine " "<" spine aaa="xxx" page-progression-direction="rtl" ">"

Have a good day.

Regards, PoJen

Hello, I release a bata version 1.0.4.4. This version add horizontal to straight , and in content.opf update language. But i don't know it still have a bug, so it only a bata version peace, ThanatosDi

PoJenHsueh commented 5 years ago

Hi, ThanatosDi:

Thanks for your prompt update into beta revision 1.0.4.4.

Here is the feedback about this beta release 1.0.4.4

I convert file as following steps (1) modify config.json to use traditional and Straight mode

{ "//" : "mode:(簡轉繁)s2t,(繁轉簡)t2s", "//" : "format:(直式)Straight,(橫式)Horizontal", "mode" : "s2t", "format": "Straight" }

(2) drag and drop the file into program. It will output filename_tc.epub.

Currently, this epub file still cannot view as the straight mode. I use the "sigil" to open this epub file. I found that there are no html section in the "Styles\stylesheet.css"

html { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -epub-writing-mode: vertical-rl; }

So I add html section into the beginning of the CSS file. Most of contents could show in the Straight mode ( Except 1st Page) I found that the 1st page (page.xhtml) for the book title already override the the default css setting.

"<" style type="text/css" title="override_css" ">"

So I insert the vertical html section under this styles.

html { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; -epub-writing-mode: vertical-rl; }

Now this epub could show as the vertical format. (Verify this epub with window edge brower and Book Bazzar reader.)

I will be graceful if you could patch this issue when you are available.

Regards, PoJen

ThanatosDi commented 5 years ago

OK, I got bug where is. Now I fix bug and release ver 1.0.5 . If have any bug please tell me. Thanks. peace, ThanatosDi

PoJenHsueh commented 5 years ago

Hi, ThanatosDi:

I download and modify the JSON file. Then run ver 1.0.5. Program stop/hang for unknown reason in the final step which program show the message "重新命名 toc.ncx.new 到 toc.ncx".

In the ver1.0.4.4, it runs well and it will show "Press any key to continue . . ." after "重新命名 toc.ncx.new 到 toc.ncx" message.

Regards, PoJen

------ v 1.0.5 program message on the screen ----

重新命名 chapter_164000437590.xhtml.new 到 chapter_164000437590.xhtml 重新命名 chapter_164000437591.xhtml.new 到 chapter_164000437591.xhtml 重新命名 catalog.xhtml.new 到 catalog.xhtml 重新命名 content.opf.new 到 content.opf 重新命名 toc.ncx.new 到 toc.ncx

------ v 1.0.4.4 program message on the screen ----

重新命名 chapter_164000437590.xhtml.new 到 chapter_164000437590.xhtml 重新命名 chapter_164000437591.xhtml.new 到 chapter_164000437591.xhtml 重新命名 catalog.xhtml.new 到 catalog.xhtml 重新命名 content.opf.new 到 content.opf 重新命名 toc.ncx.new 到 toc.ncx Press any key to continue . . .

ThanatosDi commented 5 years ago

Hello, can you send epub file to my email? Let me find bug where is. Beacause I try many files, but I didn't happened this problem. my email address: epubconv@mail.kawai.moe Thanks.

ThanatosDi commented 5 years ago

Okay, I know problem where is. This is original file tree :

original file
|--META-INF
|--catalog.xhtml
|--chapter_164000388896.xhtml
|--chapter_164000388897.xhtml
.....

This is original file tree after open with Sigil and "Save as" :

open with Sigil and "Save as"
|--META-INF
|--OEBPS
   |--Styles
   |--Text
      |--catalog.xhtml
      |--chapter_164000388896.xhtml
      |--chapter_164000388897.xhtml
   |--content.opf
   |--toc.ncx
|--mimetype
...

And when convert at "重新命名 toc.ncx.new 到 toc.ncx" didn't show "Press any key to continue . . .". In face convert still running, bug I didn't do any output. At that time program is running that search all files content to check if import css. Now v1.0.5.1 I add output text let user know still convert. peace, ThanatosDi

PoJenHsueh commented 5 years ago

Hi, ThanatosDi:

It's really awesome !!! The rev 1.0.5.1 works perfectly for "Straight" feature.

Thanks for your help and effort to make it.

Regards, PoJen