Skip to content

CJK punctuation at the start of paragraphs are not adjusted sometimes #2348

@balthild

Description

@balthild

Description

I'm not sure if this is a bug or a feature that haven't been implemented. In #954, I see that CJK right puncts appearing at line start are compressed:

image

However, I found that there're some cases these puncts are not compressed when they appear at paragraph start:

image

This causes the start of the paragraphs to look like misaligned.

Related: #276

Typst code:

#let ccwd = 12pt

// Set the text width to exact 32 Chinese characters.
#set page("iso-b5", margin: (x: 50% - ccwd * 16))

#set text(
  lang: "zh",
  font: ("Source Han Serif"),
  size: ccwd,
  overhang: false,
)

#set par(justify: true, first-line-indent: 2em)

// stripe background
#place(
  top + left,
  repeat(
    stack(
      dir: ltr,
      rect(width: ccwd, height: 24em, stroke: none, fill: rgb("#7092be70")),
      rect(width: ccwd, height: 24em, stroke: none)
    )
  )
)

first paragraph no indent

囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗

(囗囗囗囗)囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗

(囗囗囗囗)囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗ijk囗囗囗囗囗囗囗囗囗囗囗囗

(囗囗囗囗)囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗xyz囗囗囗囗囗囗囗囗囗囗囗囗

“囗囗囗囗”囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗

“囗囗囗囗”囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗ijk囗囗囗囗囗囗囗囗囗囗囗囗

“囗囗囗囗”囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗囗xyz囗囗囗囗囗囗囗囗囗囗囗囗

Use Case

This is a common case in CJK typesetting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcjkChinese, Japanese, Korean typography.textText layout, shaping, internationalization, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions