Bug 694094 - Wrong rotation of CJK puntuations in vertical writing
Summary: Wrong rotation of CJK puntuations in vertical writing
Status: CONFIRMED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-21 21:37 UTC by Hin-Tak Leung
Modified: 2020-12-31 03:17 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
vertical writing japanese pdf (6.74 KB, application/pdf)
2013-06-03 13:32 UTC, Hin-Tak Leung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Tak Leung 2013-05-21 21:37:56 UTC
(just the accompanying issue for ghostscript as Bug 694093 for mupdf - filed under 'Font API' for the moment but may change it later)

CJK bracket types (U3008 - U3011, U3014-U301B) should be rotated clockwise in vertical writing. I was shown a pdf where poppler-based applications (xpdf/evince/okular) do it correctly (from the libreofffice japan guy during the printing summit last week), while mupdf is wrong in one way and ghostscript is wrong in the opposite (180 degree from mupdf) direction for the unicode characters U300C and U300D.

Don't know whether it is rotation within poppler or an alternate glyph(using the -V chacteracter hints), but poppler does it correctly and differently from either mupdf/ghostscript. mupdf differs from ghostscript, and both are wrong.

I'll either try to get hold of that test file, find a public example, or make one.
Comment 1 Hin-Tak Leung 2013-06-03 13:32:25 UTC
Created attachment 9930 [details]
vertical writing japanese pdf

Note the positioning and rotation of the braces, as well as the punctuations.
Comment 2 Hin-Tak Leung 2013-06-03 13:44:08 UTC
compared to acrobat reader (if you don't read CJK natively...).

On the original linux system I saw it on, (probably not using DroidSanFallback), the braces are rotated 180 from mupdf's - and both wrong. With up-to-date gs from source, and embedded DroidSanFallback, the braces are alright, but the punctuations - the 3rd and 4th glyphs from top-right downwards, are 180 deg rotated from how they should be.
Comment 3 Chris Liddell (chrisl) 2013-06-06 07:03:01 UTC
What happens if the CID font is embedded? As it *really* should be, in-line with the spec.
Comment 4 Hin-Tak Leung 2013-06-06 07:56:36 UTC
If I understand correctly, truetype fonts have some sort of alternative glyph support for text-run direction being vertical? You probably need to emulate that kind of behavior with DroidSanFallback somehow.

I am just the messager... Japanese natives expect it to work (somehow) and are rather surprised that it doesn't.
Comment 5 Chris Liddell (chrisl) 2013-06-06 08:28:30 UTC
(In reply to comment #4)
> If I understand correctly, truetype fonts have some sort of alternative
> glyph support for text-run direction being vertical? You probably need to
> emulate that kind of behavior with DroidSanFallback somehow.
> 
> I am just the messager... Japanese natives expect it to work (somehow) and
> are rather surprised that it doesn't.

End user expectations do not, necessarily, dictate what is "correct" behaviour.....

Using a different font to the one used when authoring the document is *always* prone to problems of missing/mismatched glyphs, incompatible metrics and so on, and the problem is only compounded when talking about CIDFonts.

What's most important here is whether there is a problem when displaying with the intended font, as that illustrates a genuine bug with our font machinery, or whether the problem is caused by relying on a substitute font which (as *clearly* stated in the documentation) runs the risk of this type of issue arising.
Comment 6 Chris Liddell (chrisl) 2013-09-06 19:30:51 UTC
Configuring Ghostscript to use the same substitute font as poppler based apps for the CIDFont MS-Mincho results in output that I believe is correct - on my system poppler uses "wqy-microhei.ttc". So the font code is correct, given an appropriate font.

As is mentioned in the documentation, DroidSansFallback.ttf is used as a last ditch fallback to output *something* hopefully legible (feedback from users suggested that this was preferable to throwing an error, which is, strictly speaking, the correct behaviour).

The documentation is also clear that relying on substitute font like this is likely to result in wrong or missing glyphs.

We chose DroidSansFallback because it has very good glyph coverage (especially given it's file size), but it is not comprehensive.

Basically, I feel this is not unreasonably behaviour.
Comment 7 Tor Andersson 2014-06-02 11:32:39 UTC
In MuPDF we've fixed this problem by using a separate substitute font for horizontal and vertical writing modes. MuPDF's DroidSansFallback is a TTC which has both variants.

See bug 694093 and commit 0f0653cac62c7dbcd4b4cd2ea57640769271365c in mupdf.git
Comment 8 Peter Cherepanov 2020-12-31 03:17:13 UTC
In the default configuration, brackets are now correct but punctuation is still misplaced.