Pomax / ucharclasses

A XeLaTeX package that lets you insert arbitrary code between characters from different unicode blocks
14 stars 4 forks source link

ucharclasses no longer does automatic Devanagari transitions in TeXLive 2021 #36

Closed ijya closed 2 years ago

ijya commented 2 years ago

I have recently updated to Fedora 35 and TeXLive 2021. I notice that the package ucharclasses no longer does automatic Devanagari transitions and I have to switch font manually. A MWE:

\documentclass{article}

\usepackage{fontspec}
\newfontfamily\s[Script=Devanagari]{Shobhika-Regular} % Or any other Devanagari font

\usepackage[Devanagari,Latin]{ucharclasses}
\setTransitionTo{Devanagari}{\s}
\setTransitionFrom{Devanagari}{\rmfamily}

\begin{document}
English देवनागरी English देवनागरी \\
English {\s देवनागरी} English {\s देवनागरी}

\end{document}

The above transition commands have always worked for me before for more than 5-6 years and I have many .tex files using the same.

Pomax commented 2 years ago

The only recent change is the support for Unicode 14, @lemzwerg would this have broken devanagari?

lemzwerg commented 2 years ago

No, it's not me. It's commit a8864b9ba3d, added to the repository five(!) years ago.

Devanagari is no longer treated as a single script (i.e., a single Unicode block); it's a class now (also called an 'informal group' in the manual), consisting of multiple blocks. If you replace

\setTransitionTo{Devanagari}{\s}
\setTransitionFrom{Devanagari}{\rmfamily}

with

\setTransitionsForDevanagari{\s}{\rmfamily}

everything works as expected.

Mike, this is a documentation bug.

[Another thing: Tags for releases later than v2.3.0 are missing in the repository. Maybe you forgot to execute git push --tags?]

ijya commented 2 years ago

Ok thanks. That seems to work! Strangely enough, I have not faced this bug even in TeXlive 2020. Nevertheless, the given solution works and solves a huge problem! Thank you.

Pomax commented 2 years ago

I've filed https://github.com/Pomax/ucharclasses/issues/38 to fix the docs, and https://github.com/Pomax/ucharclasses/issues/37 for the missing tags.