readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
276 stars 112 forks source link

Strange waving mark on vertical CJK content #222

Closed iaomw closed 3 years ago

iaomw commented 6 years ago

R2Reader img_3116 iBooks img_3117

JayPanoz commented 6 years ago

Hmmm, looks like an overlapping issue because the line-height is solid there – that’s weird because we give more room to CJK and the default line-height is 20% bigger than for latin scripts.

As for the wave I have difficulties defining whether this is text-emphasis-style with a custom string, text-underline-style: wavy and or a background-image – which is a popular technique for such things.

JayPanoz commented 6 years ago

On a related note, I can also see missing characters in both screenshots (they happen to be the same one):

capture d ecran 2018-08-10 a 12 11 27

capture d ecran 2018-08-10 a 12 11 39

iaomw commented 6 years ago

https://drive.google.com/file/d/1CSZXEscGXkdNharMjOknYc82CJEXyvZ1/view?usp=sharing Testing sample

JayPanoz commented 6 years ago

OK so it’s a background-image

span.kindle-cn-specialtext-double{
     background-image: url(../Images/image00788.gif);
     background-repeat: repeat-y;
     background-size:1em 1em;
     background-position: 0% 0%;
     padding-left: 0.15em;
     margin-bottom: 0em ;
}

And here’s the GIF:

wavy underline

What’s weird is that line-height in r2 looks like normal while it should be the result of https://github.com/readium/readium-css/blob/master/css/src/modules/ReadiumCSS-base.css#L38 with a compensation of 1.167 (https://github.com/readium/readium-css/blob/master/css/src/modules/ReadiumCSS-base.css#L197)

What’s strange is that this is the line-height I get, which is very different from the one in the first screenshot:

capture d ecran 2018-09-18 a 11 33 59

A couple of extra notes:

  1. the file is ePub 2 (not EPUB3)
  2. it is specifically authored for Kindle (all class names start with kindle)
  3. It is using <meta content="vertical-rl" name="primary-writing-mode" /> (cf. compat doc) in addition to page-progression-direction.

I’m assuming this wasn’t a Kindle Mobi file converted back to EPUB as it lacks some meta artifacts you’ll typically find in such retro-conversions… but maybe I’m wrong?

JayPanoz commented 6 years ago

Also extra notes related to https://github.com/readium/architecture/issues/70

cc @HadrienGardeur and @llemeurfr

If this isn’t retroconverted, that could be either an exception or the rule, in which latter case… the number of such files could be massive on markets we are not necessarily familiar with.

mickael-menu commented 3 years ago

From what I gather it's nothing we can fix in the Swift projects directly. Feel free to reopen the issue with more details on how to fix this in Swift if I misunderstood.