Pomax / ucharclasses

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

problems with Spacing Modifier Letters and Combining Diacritical Marks #13

Open jonorthwash opened 8 years ago

jonorthwash commented 8 years ago

I just posted this question on the LaTeX stackexchange before finding the ucharclasses repo. Am I right that the issue I encountered is a bug or limitation, or am I doing something wrong?

Pomax commented 8 years ago

hmm... if it's not too much trouble, could you add those minimal verifiable complete examples to this bug (ideally, one per comment)? That'll make it easier to check and track for me.

jonorthwash commented 8 years ago
  1. Conventional approach.
\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[Latin, Phonetics, Diacritics, SpacingModifierLetters]{ucharclasses}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\newfontfeature{IPA}{+mgrk}
\setmainfont[IPA]{DejaVu Sans}
\newfontfamily\dejavuserif[IPA]{DejaVu Serif}

\setTransitionsFor{IPAExtensions}{\dejavuserif}{\normalfont}
\setTransitionsFor{CombiningDiacriticalMarks}{\dejavuserif}{\normalfont}
\setTransitionsFor{SpacingModifierLetters}{\dejavuserif}{\normalfont}

\begin{document}
\thispagestyle{empty}

thaaw [tʰɑɑɯ] [tɑɑɯ] [tʰɑ́ɑɯ] [tɑ́ɑɯ] thaaw

\end{document}
jonorthwash commented 8 years ago

(2) Based on this question:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[Latin, Phonetics, Diacritics, SpacingModifierLetters]{ucharclasses}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\newfontfeature{IPA}{+mgrk}
\setmainfont[IPA]{DejaVu Sans}
\newfontfamily\dejavuserif[IPA]{DejaVu Serif}

\setTransitionTo{IPAExtensions}{\dejavuserif}
\setTransitionFrom{IPAExtentions}{\normalfont}
\setTransitionTo{CombiningDiacriticalMarks}{\dejavuserif}
\setTransitionFrom{CombiningDiacriticalMarks}{\normalfont}
\setTransitionTo{SpacingModifierLetters}{\dejavuserif}
\setTransitionFrom{SpacingModifierLetters}{\normalfont}

\begin{document}
\thispagestyle{empty}

thaaw [tʰɑɑɯ] [tɑɑɯ] [tʰɑ́ɑɯ] [tɑ́ɑɯ] thaaw

\end{document}
jonorthwash commented 8 years ago

(3) Based on this question:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[Latin, Phonetics, Diacritics, SpacingModifierLetters]{ucharclasses}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\newfontfeature{IPA}{+mgrk}
\setmainfont[IPA]{DejaVu Sans}
\newfontfamily\dejavuserif[IPA]{DejaVu Serif}

\setTransitionsFor{IPAExtensions}{\begingroup\dejavuserif}{\endgroup}
\setTransitionsFor{CombiningDiacriticalMarks}{\begingroup\dejavuserif}{\endgroup}
\setTransitionsFor{SpacingModifierLetters}{\begingroup\dejavuserif}{\endgroup}

\begin{document}
\thispagestyle{empty}

thaaw [tʰɑɑɯ] [tɑɑɯ] [tʰɑ́ɑɯ] [tɑ́ɑɯ] thaaw

\end{document}
jonorthwash commented 8 years ago

(4) Based on this question:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[Latin, Phonetics, Diacritics, SpacingModifierLetters]{ucharclasses}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\newfontfeature{IPA}{+mgrk}
\setmainfont[IPA]{DejaVu Sans}
\newfontfamily\dejavuserif[IPA]{DejaVu Serif}

\makeatletter
\setTransitionsFor{IPAExtensions}
    {\let\curfamily\f@family\let\curshape\f@shape\let\curseries\f@series\dejavuserif}
    {\fontfamily{\curfamily}\fontshape{\curshape}\fontseries{\curseries}\selectfont}
\setTransitionsFor{SpacingModifierLetters}
    {\let\curfamily\f@family\let\curshape\f@shape\let\curseries\f@series\dejavuserif}
    {\fontfamily{\curfamily}\fontshape{\curshape}\fontseries{\curseries}\selectfont}
\setTransitionsFor{CombiningDiacriticalMarks}
    {\let\curfamily\f@family\let\curshape\f@shape\let\curseries\f@series\dejavuserif}
    {\fontfamily{\curfamily}\fontshape{\curshape}\fontseries{\curseries}\selectfont}

\makeatother

\begin{document}
\thispagestyle{empty}

thaaw [tʰɑɑɯ] [tɑɑɯ] [tʰɑ́ɑɯ] [tɑ́ɑɯ] thaaw

\end{document}
Pomax commented 8 years ago

thanks! I'll try to see what's going on with this hopefully today

jonorthwash commented 8 years ago

Any updates on this? Ulrike Fischer added a comment to the stackexchange question that suggests both a place to look regarding the issue and a point that suggests that the desired behaviour may be hard to define in the first place.

Pomax commented 8 years ago

I've unfortunately not had any time to look at this yet, and might not get to it for at least another few days =(

jonorthwash commented 8 years ago

Understood. I'll keep an eye out for whatever you find when you're able to.

Shreeshrii commented 7 years ago

I am having similar issues with using combining marks in DevanagariExtended and VedicExtensions range with devanagari and other Indian script fonts which do not have these characters.

Some of the approaches above show the combining mark separately - with dotted circle.

The only approach that has worked correctly is when the combining mark is surrounded by uccoff and uccon - eg. ठ\uccoff{\fontspec{Siddhanta}᳚}\uccon ठ\uccoff{\fontspec{Siddhanta}꣱}\uccon

Siddhanta font supports these combining marks not available in other fonts - http://svayambhava.blogspot.in/p/siddhanta-devanagariunicode-open-type.html