Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xeCJK 与思源系字体的破折号 #444

Closed
Ranqumn opened this issue Jul 29, 2019 · 3 comments
Closed

xeCJK 与思源系字体的破折号 #444

Ranqumn opened this issue Jul 29, 2019 · 3 comments

Comments

@Ranqumn
Copy link

Ranqumn commented Jul 29, 2019

xeCJK 好像自动把省略号设置成中文的,然而没有把破折号设置成中文的……

相关参考资料:

与破折号有关的 issue:

样例

使用 xeCJK

使用思源黑体

\documentclass{ctexart}

\XeTeXgenerateactualtext=1

\setCJKmainfont{Noto Sans CJK SC}

\begin{document}

美图——国家 % two U+2014

美图⸺国家 % one U+2E3A

美图……国家 % two U+2026

\addCJKfontfeatures{Script=CJK Ideographic,Language=Chinese Simplified}

美图——国家 % two U+2014

美图⸺国家 % one U+2E3A

美图……国家 % two U+2026

\end{document}

issue-font-source-han-1

嗯?为什么破折号中间断开了?

似乎它没有拼成 U+2E3A,还是两个 U+2014

然而,如果开了 \XeTeXgenerateactualtext=1 复制还是可以复制成 U+2E3A

如果没开 \XeTeXgenerateactualtext=1 还是两个 U+2014

使用思源宋体

\documentclass{ctexart}

\XeTeXgenerateactualtext=1

\setCJKmainfont{Noto Serif CJK SC}

\begin{document}

美图——国家 % two U+2014

美图⸺国家 % one U+2E3A

美图……国家 % two U+2026

\addCJKfontfeatures{Script=CJK Ideographic,Language=Chinese Simplified}

美图——国家 % two U+2014

美图⸺国家 % one U+2E3A

美图……国家 % two U+2026

\end{document}

issue-font-source-han-2

不使用 xeCJK

使用思源黑体

\documentclass{article}

\usepackage{fontspec}

\XeTeXgenerateactualtext=1

\setmainfont{Noto Sans CJK SC}

\begin{document}

美图——国家

美图⸺国家

美图……国家

\addfontfeatures{Script=CJK Ideographic,Language=Chinese Simplified}

美图——国家

美图⸺国家

美图……国家

\end{document}

issue-font-source-han-3

使用思源宋体

\documentclass{article}

\usepackage{fontspec}

\XeTeXgenerateactualtext=1

\setmainfont{Noto Serif CJK SC}

\begin{document}

美图——国家

美图⸺国家

美图……国家

\addfontfeatures{Script=CJK Ideographic,Language=Chinese Simplified}

美图——国家

美图⸺国家

美图……国家

\end{document}

issue-font-source-han-4

好迷好迷

……所以,排版应该怎么处理比较好?

@Ranqumn
Copy link
Author

Ranqumn commented Jul 29, 2019

呃?好像发现已经有讨论了,我似乎重复发了……

@Ranqumn
Copy link
Author

Ranqumn commented Jul 29, 2019

所以,一个好像可行的方案是这样的?

\documentclass{ctexart}

% 将 U+2014 破折号合字
% via: https://github.com/CTeX-org/ctex-kit/issues/382#issuecomment-430873626

\ExplSyntaxOn
\xeCJK_new_class:n { PoZheHao }
\__xeCJK_save_CJK_class:n { PoZheHao }
\xeCJK_declare_char_class:nn { PoZheHao } { "2014 }
\seq_map_inline:Nn \g__xeCJK_class_seq
  {
    \str_if_eq:nnF {#1} { PoZheHao }
      {
        \xeCJK_copy_inter_class_toks:nnnn { PoZheHao } {#1} { FullRight } {#1}
        \xeCJK_copy_inter_class_toks:nnnn {#1} { PoZheHao } {#1} { FullRight }
      }
  }
\ExplSyntaxOff

\setCJKmainfont{Noto Sans CJK SC}[Script=CJK Ideographic,Language=Chinese Simplified]

\begin{document}

美图——国家 % two U+2014

美图⸺国家 % one U+2E3A

美图……国家 % two U+2026

{\fangsong 美图——国家} % two U+2014

{\kaishu 美图——国家} % two U+2014

{\heiti 美图——国家} % two U+2014

{\songti 美图——国家} % two U+2014

\end{document}

issue-font-source-han-5

这样做好像对 Fandol 系字体没有什么影响。

@stone-zeng
Copy link
Member

因为只有思源这么做了,其他的中文字体一般都是把两个 U+2014 作为破折号。

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

No branches or pull requests

2 participants