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 汉字部分标点影响 pifont 等符号宏包的正常功能 #59

Closed
leo-liu opened this issue Mar 16, 2015 · 3 comments
Closed
Assignees

Comments

@leo-liu
Copy link
Member

leo-liu commented Mar 16, 2015

Original issue 60 created by LeoLiu.PKU on 2011-09-11T12:24:27.000Z:

当前版本:xeCJK 2.4.3 即 r267
中文使用的间隔号 U+00B7(·)被作为中文标点使用,字符类别目前是 1(普通 CJK 文字)。但在 pifont 符号宏包中,\ding{"B7} 是带圈数学 2,它是 U 编码的符号。因而在 xeCJK 下,\ding{"B7} 会被输出为汉字标点。

重现代码:

\documentclass{article}
\usepackage{xeCJK}
\usepackage{pifont}

\setCJKmainfont{SimSun}

\begin{document}
编号 \ding{"B7}
\end{document}

目前的一种解决方式:

\renewcommand{\Pifont}[1]{\fontfamily{# 1}\fontencoding{U}%
\fontseries{m}\fontshape{n}\selectfont\makexeCJKinactive}

现在需要考虑是对 pifont 等符号宏包单独判断并做 patch 好,还是使用某种简单允许用户自己处理这些问题好——或者二者可以都完成。

目前 \xeCJKsetcharclass 会忽略对标点符号的修改,而 U+00B7 也在其列,因而 \xeCJKsetcharclass 机制在此失效;而如上 \makexeCJKinactive 当然是可用的。可以考虑修改 \xeCJKsetcharclass 的行为,减小它的限制,使之更为强大也更为危险。

@leo-liu leo-liu self-assigned this Mar 16, 2015
@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #1 originally posted by LeoLiu.PKU on 2011-09-11T12:25:15.000Z:

原问题由 CTeX 论坛的 hyry 报告。
参见:
http://bbs.ctex.org/viewthread.php?tid=66390

@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #2 originally posted by LeoLiu.PKU on 2011-09-11T16:50:33.000Z:

前述的解决方式只能处理 pifont 的情况。还有其他问题:

U+00B7 在扩展 ASCII 码的范围之中,因而还会影响 T1、TS1 等其他编码。在 T1 编码中它是符号 \r{u}(ů,U+016F),在 T3 编码中是音标符号 ʯ(U+02AF),在 TS1、LY1 编码中仍然是间隔号,等等。

主要是 T1 编码的旧字体中的 ů 会受到影响。这虽然不常见(这也不是 fontspec 推荐的用法),但可能还是可能会在汉字字体配合传统西文字体包时出现(目前 ctex 宏包支持这样做)。例如:

\documentclass{ctexart}
\usepackage{fourier}
\begin{document}
汉字 x\r{u}y
\end{document}

对于这种情况更难得出一般的好结果。只能留下用户选择的余地。

@leo-liu
Copy link
Member Author

leo-liu commented Mar 16, 2015

Comment #3 originally posted by LeoLiu.PKU on 2011-09-16T20:02:04.000Z:

r271 fixed.

对命令 \r、宏包 pifont、宏包 tipa 做了特殊处理。

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

No branches or pull requests

1 participant