question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Japanese text in vertical writing mode rendered with glyphs for horizontal writing

See original GitHub issue

Attach (recommended) or Link to PDF file here:

https://www.mofa.go.jp/mofaj/gaiko/treaty/pdfs/treaty159_4a.pdf (via https://www.mofa.go.jp/mofaj/gaiko/treaty/treaty159_4.html)

Configuration:

  • Web browser and its version: Firefox 80.0.1
  • Operating system and its version: Windows 10 Home (Version 10.0.19041 build 19041)
  • PDF.js version: 2.6.123
  • Is a browser extension: yes (built-in)

Steps to reproduce the problem: open the PDF and jump to page 2.

What is the expected behavior? (add screenshot)

image

What went wrong? (add screenshot)

image

Glyphs , and are in horizontal form. (cf. Requirements for Japanese Text Layout 3.1.1 Differences in Vertical and Horizontal Composition in Use of Punctuation Marks )

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): n/a

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
THausherrcommented, Sep 9, 2020

It’s also in page 1. The font is named “Ryumin-regular-Identity-H” and the encoding is “Identity-H”. I suspect that Adobe itself notices that this is vertical writing and then displays that glyph differently.

1 g
/GS2 gs
0 841 m
0 841 l
f
q
  1 i
  0 841 595 -841 re
  0 841 m
  W
  n
  0.06 840.96 594.96 -840.96 re
  W
  n
  BT
    /G1 1 Tf
    20 0 0 20 287.64 681.67 Tm
    0 0 0 1 k
    0 Tc
    0 Tw
    (\003\261) Tj
    0 -1 TD
    (\003\240) Tj
    T*
    (\003\314) Tj
    T*
    (\036\323) Tj      % this is 0x1ED3 = 7891d
    T*
    (\015\\) Tj
    T*
    (\010Q) Tj
    T*
    (\003t) Tj
    T*
    (\006\024) Tj
    T*
    (\003b) Tj
    T*
    (\003\224) Tj
    T*
    (\011\332) Tj
    T*
    (\016\377) Tj
  ET
Q

0reactions
yuis-icecommented, Jul 26, 2022

I have a similar problem. In my case I’m reading a study paper where mainly in horizontal format but sometimes vertical context with a graph. The problem is that when I search text in say Foxit it recognizes the text but in the pdf.js viewer view when I search text it doesn’t recognize the text but does recognize horizontal texts. So for instance I’m seeing the problem like when I search a word in Foxit it finds lets say 60 match results, but in pdf.js 55 match results, like that.

Simply, this is a crucial problem when I cannot miss a match when I query a search. Is this a same issue to OP’s?? let me know if it doesn’t I’ll open a new issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styling vertical Chinese, Japanese, Korean and Mongolian text
This article explains how to use CSS to produce vertical text for languages such as Chinese, Japanese, Korean, and Mongolian.
Read more >
Re: [Freetype] Font files and vertical text - The Mail Archive
When writing horizontally, the horizontal origin of a character is placed at the pen position passed into the renderer, and the glyph is...
Read more >
text-orientation - CSS: Cascading Style Sheets - MDN Web Docs
The text-orientation CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when writing- ......
Read more >
5 Characters, Glyphs, and Writing ... - Text Encoding Initiative
⚓︎5.7.2 Vertical Text with Embedded Horizontal Text. When Japanese is written vertically, the glyph orientation remains the same as when it is ...
Read more >
Text — SVG 2
SVG's 'text' elements are rendered like other graphics elements. ... For horizontal writing-modes, the glyphs' alignment points are vertically aligned while ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found