Skip to content

feat: add support for vertical writing mode#1013

Open
KewenCode wants to merge 6 commits intolinebender:mainfrom
KewenCode:feature/UAX#50
Open

feat: add support for vertical writing mode#1013
KewenCode wants to merge 6 commits intolinebender:mainfrom
KewenCode:feature/UAX#50

Conversation

@KewenCode
Copy link

@KewenCode KewenCode commented Feb 1, 2026

  1. Add support for alternative glyphs in vertical text mode when the font supports the 'vert' attribute.
    • Base on document UAX#50.
    • Add two test for vertical text.
      Test Chrome-Origin Chome-Current
      symbol-text symbol-text-chrome symbol-text-resvg
      text-cjk text-cjk-chaome text-cjk-resvg
      • In 'text-cjk', after applying feature vhal to the character , the harfbuzz rendering differs from that of Chrome, resulting in reduced spacing.

    • Finish Font rendering with vertical text #890
      • The direction of the character 'っ' (TR) was incorrect, and it has now been corrected to meet the relevant requirements of UAX#50.

    • Two tests underwent changes due to improved functionality
      text\textPath\complex text\writing-mode\tb-and-punctuation
      tests_text_textPath_complex tests_text_writing-mode_tb-and-punctuation

  2. Add font to support all CJK text.
    • Font SourceHanSansHWSC-Regular.subset.ttf to support tests.
    • Due to the presence of CJK text in the four tests, the fallback font has been changed to new font.
      Location Diff Location Diff
      text\text\xml-lang=ja tests_text_text_xml-lang=ja text\writing-mode\tb-with-rotate tests_text_writing-mode_tb-with-rotate
      text\writing-mode\mixed-languages-with-tb-and-underline tests_text_writing-mode_mixed-languages-with-tb-and-underline text\writing-mode\tb-with-rotate-and-underline tests_text_writing-mode_tb-with-rotate-and-underline

  3. Add two OpenType features (vhal halt) to accommodate CJK text.

@RazrFalcon
Copy link
Collaborator

Wow! That's a serious change. I'm no Unicode/Text Layout expert, so I would assume it's better.
As long as it does not break existing test - we're fine.

Does it actually fixes #890 ?

Also, 16MB for SourceHanSansHWSC-Bold.otf‎ is too much. Getting it below 1MB would be nice.
Can you try subsetting it as mentioned here?

Also, can you post new test file results before and the patch? Just for the reference. I want to see how exactly thing have changed. Thanks!

@KewenCode
Copy link
Author

Wow! That's a serious change. I'm no Unicode/Text Layout expert, so I would assume it's better. As long as it does not break existing test - we're fine.

Does it actually fixes #890 ?

Also, 16MB for SourceHanSansHWSC-Bold.otf‎ is too much. Getting it below 1MB would be nice. Can you try subsetting it as mentioned here?

Also, can you post new test file results before and the patch? Just for the reference. I want to see how exactly thing have changed. Thanks!

Sorry to keep you waiting. The setup of fonttools has puzzled me for quite a while。
And thank you for your suggestion. I have optimized the font file and added a comparison image.

@RazrFalcon
Copy link
Collaborator

Thanks! Looks good to me.

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.

2 participants