-
Notifications
You must be signed in to change notification settings - Fork 126
Description
The AlternateFont option in \setCJKmainfont macro provides mechanism to load different fonts before the boring expansion spec gets adopted and well supported. However, I am wondering how we can support IVD characters in two different fonts. Given that the variation selector block ("E0100->"E01EF) has to be somehow shared by both fonts.
Here is an example. In this example we set main CJK font as BabelStoneHanExtra and fallback to BabelStoneHanBasic:
% !TeX program = lualatex
\documentclass[a4paper,12pt]{article}
\usepackage[fontset=none,scheme=plain,punct={kaiming}]{ctex}
% Switch between these two to observe desired UVS support
\setCJKmainfont[Path=fonts/,AlternateFont={{"3400->"FFFF}{BabelStoneHanBasic.ttf}{Color=FF0000}}]{BabelStoneHanExtra.ttf}
% \setCJKmainfont[Path=fonts/,AlternateFont={{"20000->"10FFFF}{BabelStoneHanExtra.ttf}{Color=FF0000}}]{BabelStoneHanBasic.ttf}
\begin{document}
\title{Testing CJK Fonts with Alternate Characters}
\author{Two Wang}
\date{\today}
\maketitle
\section{BSH Extra Alternate Basic}
\begin{tabular}{ll}
U+514F & {兏} \\
U+514F+VS19 & {兏󠄂} \\
U+2017F & {𠅿} \\
U+2017F+VS22 & {𠅿󠄅} \\
\end{tabular}
\end{document}It is currently rendered as
Note that the IVD in BabelStoneHanExtra is respected, while the IVD in BabelStoneHanBasic is not.
Now if we set BabelStoneHanBasic as main CJK and fallback to BabelStoneHanExtra, it will be rendered as:
where the IVD support is the opposite.
Here is the reproduction repo if you want to take a look, thank you.