Skip to content

Fix compression of punctuation marks at line start of end - #3744

Merged
laurmaedje merged 7 commits into
typst:mainfrom
Jocs:fix/compression-end-punctuation
Apr 1, 2024
Merged

laurmaedje merged 7 commits into
typst:mainfrom
Jocs:fix/compression-end-punctuation

Conversation

@Jocs

@Jocs Jocs commented Mar 21, 2024 •

Copy link
Copy Markdown
Contributor

fix #3743 No need to add stretchability of the first or last CJK punctuation glyph to avoid stretching in line adjustment.

@Jocs Jocs changed the title Fix compression of punctuation marks at line end Fix compression of punctuation marks at line start of end Mar 21, 2024
@laurmaedje

Copy link
Copy Markdown
Member

cc: @peng1999 who is most familiar with this part of the codebase

Comment thread crates/typst/src/layout/inline/mod.rs Resolved
@Jocs

Jocs commented Mar 25, 2024

Copy link
Copy Markdown
Contributor Author

@peng1999 Please review it again.

@peng1999

Copy link
Copy Markdown
Contributor

I think its better to add a test for the punctuation adjustment behavior when line is underfull.

You can construct a line with following property:

  • Inter-character space expansion
  • Have punctuation marks on line start and end
  • Have consecutive punctuation marks within
image

The above is my quick sketch from Microsoft Word.

Comment thread tests/typ/layout/par-justify-cjk.typ Resolved
@peng1999

Copy link
Copy Markdown
Contributor

LGTM

@laurmaedje
laurmaedje added this pull request to the merge queue Apr 1, 2024
@laurmaedje

Copy link
Copy Markdown
Member

Thanks to both of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compression of punctuation marks at line end is not work in simple linebreak mode

3 participants