7

I am trying to enable font protrusion for Charis SIL in microtype when typesetting with the XeTeX engine. The mycrotype manual indicates that it has protrusion settings for Charis SIL, but only in the EU1 and EU2 encodings. Per the answer from Alan Munn, fontenc automatically uses the EU1 encoding, so I don't need to do anything special to get characters in Charis SIL to protrude.

Does microtype have protrusion settings for Charis SIL small caps as well? I am getting a string of warnings when I typeset to the effect of "Unknown slot number of character ____ in font encoding EU1 in protrusion list Charis-sc." This error only shows up when my source has small capitals. Here is a minimal example that produces the errors:

\documentclass[12pt,draft]{memoir}
\usepackage{fontspec}
\setmainfont{Charis SIL}[StylisticSet=1]
\usepackage[final, expansion = false]{microtype}
\begin{document}
\section{Introduction}

Now a sentence, with, many; types --- of punctuation!  Can, you believe it?  I am making: words.  And more... And more.

But if I decide to \textsc{nasa} me around, I disagree.

\end{document}
  • 1
    eu1 and eu2 are the same encoding fontspec calls Unicode EU1 when using xetex and EU2 when using luatex (or now has a new tuenc option to call it TU in both) it's just related to some internal syntax differences with font loading so you should not need to do anything – David Carlisle Aug 10 '16 at 23:57
  • We need a minimal document we can compile to reproduce the warnings - ideally one warning, which you give the exact text of here to double-check we're getting the same thing. – cfr Aug 11 '16 at 23:15
  • I don't get any warnings about unknown slots. Instead, I get warnings that the feature Variant=1 is not available for Charis SIL. – Robert Aug 12 '16 at 16:32
  • @Robert THAT error has to do with the "Stylistic Set 1". I don't know why you would get that error and not the ones about small caps... – ltcomdata Aug 13 '16 at 1:43
  • 1
    OK, I've downloaded version 5 of Charis, and they have renamed the small caps glyphs from a.SC to a.sc etc. Changing the glyph names in the file mt-CharisSIL.cfg fixes the warnings. – Robert Aug 14 '16 at 21:16
4

The small caps protrusion settings for Charis SIL are specified by referring to the glyph names, which is usually the most stable way. At some point, however, the developers of Charis SIL have renamed all small caps glyphs from, say, a.SC to a.sc:

Charis SIL

(left: version 4.106, right: version 5.000)

EDIT: As of version 2.7, microtype will automatically choose the right names both with luatex and xetex, so it is no longer necessary to fix the settings manually (in mt-CharisSIL.cfg).

  • This would be a good update for the microtype creators to know for the next version, right? I wonder if I should contact them to let them know... – ltcomdata Sep 3 '16 at 17:03
  • This is still an issue with just updated TeXLive 2016. – wilx Apr 4 '17 at 21:32
5

The EU1 encoding is the standard encoding used by fontspec with XeTeX. As of 2016 there is an experimental TU encoding which will be used, but at time of writing, this encoding is enabled only by a package option [tuenc], although should become the default. The microtype package already supports this encoding too. So, you should not need to do anything special:

\documentclass{article}
\usepackage{fontspec}
\usepackage[protrusion=true]{microtype}
\setmainfont{Charis SIL}
\makeatletter
\newcommand*{\showenc}{The encoding is \f@encoding.\par}
\makeatother
\begin{document}
\showenc
\end{document}

output of code

There are some protrusion settings in the mt-CharisSIL.cfg file for small caps, and your document produces no warnings or errors using microtype 2016/05/14 v2.6a (when I remove the [StylisticSet=1] from the \setmainfont command.)

  • microtype already supports the TU encoding – Robert Aug 11 '16 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.