1

The fontspec manual mentions a feaure called mapping. However, it does not really document lots about it:

Mapping enables a XeTeX text-mapping scheme, shown in Example 40.

Using the tex-text mapping is also equivalent to writing Ligatures=TeX. The use of the latter syntax is recommended for better compatibility with LuaTeX documents.

I have also seen a number of questions around here that talk about using the feature:

But the contents are usually just ‘use this in this way. Profit.’

The basic gist I get is that I need to prepare a text file including a set of mapping rules, run it through the compiling command, put it where XeTeX can find it and then include the command mapping=myMap when selecting a font. I have a feeling that I could use that to implement German blackletter s typesetting rules (when to typeset a plaintext s as s and when as ſ). I would like to learn more about what I need to take care of when putting together a .map file.

Does a ‘tutorial’ of some kind exist online that I could be pointed to?

Or, in the absence of one:

  • What can mapping do, what can it not do?
  • At which point in document processing is mapping applied?
  • Are there any pitfalls I want to avoid?
  • That would be better implemented in the font itself, I guess. At least, that's how I would do it with traditional TeX fonts and I guess the idea would be the same with opentype. – cfr Jan 2 '17 at 1:09
  • It looks very much like the way you'd define ligatures etc. for traditional TeX fonts and encodings. I don't know what the German rules are. For English, I believe that you would avoid using longs at the end of a word (according to Wikipedia). I know how to set this up for a traditional TeX font (without needing to make anything active), but I don't know if you can do it this way for XeTeX of if you'd need something similar to tex.stackexchange.com/questions/217943/… (but forward-looking). – cfr Jan 2 '17 at 2:04
  • I'm guessing this is more straightforward to do with a traditional TeX font than it is to do it in XeTeX as an afterthought added onto an opentype font which does not implement it itself. – cfr Jan 2 '17 at 2:06
  • 1
    My understanding of the ſ-rules is that they are different in different period and different languages, so OpenType features is not a suitable way to implement them. Also, as a general rule, OpenType features that replace glyphs for an encoded character (s here) with those of another encoded character (ſ) is considered a bad idea as it breaks the association between the underlying text and the visual representation. Mapping files might be a better idea based on the regularity of the rules, otherwise one should just enter ſ when needed, that why it was encoded after all. – Khaled Hosny Jan 6 '17 at 16:30
  • This is probably a duplicate of tex.stackexchange.com/q/3458/729 – Khaled Hosny Jan 6 '17 at 16:33

Your Answer

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

Browse other questions tagged or ask your own question.