slavonic / cu-tex

Church Slavonic support for TeX and derivatives
MIT License
5 stars 2 forks source link

added automatic coloring of symbols in PUA ee00-ee3f #52

Closed pgmmpk closed 6 years ago

pgmmpk commented 6 years ago

To test, one can compile this:

\documentclass{article}
\usepackage{fontspec}
\usepackage{churchslavonic}
\newfontfamily{\slv}[Scale=1.0]{MenaionUnicode.otf}
\newfontfamily{\moo}[Scale=1.5]{MezenetsUnicode.otf}
\let\cuKrukFont=\moo

\begin{document}

%
\Large\slv

\cuKrukPara[topMargin=1em]{%
                           \\
 Тво-ѧ      по-бѣ-ди-те-ле-на-ѧ           де-сни-ца-~     бо-го-лѣ-пно      во крѣ-по
}%

\end{document}
typiconman commented 6 years ago

I can confirm that it works. However (this is a problem with color in general, not this particular code), correct positioning of marks is only achieved in LuaTeX using the package luacolor.

Compare: in LuaTeX using luacolor: luatex

in XeTeX: xetex

I guess the least we can do is change our documentation to compile with luatex.

typiconman commented 6 years ago

Perhaps we should provide an option to turn off automatic coloring of marks? This could be useful if XeTeX / LuaTeX ever support COLR and CPAL tables in fonts. Looks like they're getting there: there is now support for it in HarfBuzz, they're developing an API: https://github.com/harfbuzz/harfbuzz/issues/849 So hopefully sometime soon it will be available in TeX.

pgmmpk commented 6 years ago

Cool. I think the best option would be to sense the engine type and version and dynamically enable/disable automatic coloring. Lets wait for the first engine to support COLR/CPAL (whatever it is).

I think the COLR/CPAL mechanism will have one drawback - no grayscale/bw modes. Right?

typiconman commented 6 years ago

Good question. I think it may be possible to use stylistic sets to turn palettes off and on, but I have not tried it.

Of course, a trivial solution is just to provide a bw version of the font with no color data.