Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Here is a small example:

\documentclass[11pt,article,oneside]{memoir}

\usepackage{fontspec}
\setmainfont[ItalicFont={BerlIt}, FeatureFile=myligatures.fea]{Berling}
\begin{document}
``Lala la''
\end{document}

enter image description here

The myligatures.fea comes from this question and now I would like to use the quotation marks that I know the font have at glyph position 105 and 119 instead. Is there a way I can map these to be used instead?

Worth noticing is that if I copy the unicode symbols from Wikipedia and use them it works, however that would be a pain of search replace and something that I would want LuaLaTeX to do for me...

\documentclass[11pt,article,oneside]{memoir}

\usepackage{fontspec}
\setmainfont[ItalicFont={BerlIt}, FeatureFile=myligatures.fea]{Berling}
\begin{document}
``Lala la''

“Lala la”
\end{document}

enter image description here

share|improve this question
3  
Did you try adding Ligatures=TeX to the options? –  egreg Jun 13 '13 at 14:13
    
Have now and it worked. Almost too easy... –  jonalv Jun 13 '13 at 14:31
    
I suppose one now should be wondering: “why?” –  jonalv Jun 13 '13 at 14:35
2  
The '' ligature and the similar others are not enabled in OpenType fonts; they're a TeX tradition. –  egreg Jun 13 '13 at 14:36
    
Sorry for being late in answering. –  egreg Jul 26 '13 at 22:05

1 Answer 1

up vote 5 down vote accepted

Ligatures such as `` for and '' for are traditional in the TeX world, but they aren't defined in OpenType or TrueType fonts.

The Ligatures=TeX option when selecting a font enables them and a few others; with XeLaTeX it loads the tex-text.map file (actually its byte encoded equivalent)

; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D                   <>      U+2013  ; -- -> en dash
U+002D U+002D U+002D    <>      U+2014  ; --- -> em dash

U+0027                  <>      U+2019  ; ' -> right single quote
U+0027 U+0027   <>      U+201D  ; '' -> right double quote
U+0022                   >      U+201D  ; " -> right double quote

U+0060                  <>      U+2018  ; ` -> left single quote
U+0060 U+0060   <>      U+201C  ; `` -> left double quote

U+0021 U+0060   <>      U+00A1  ; !` -> inverted exclam
U+003F U+0060   <>      U+00BF  ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C   <>      U+201E  ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C   <>      U+00AB  ; << -> LEFT POINTING GUILLEMET
U+003E U+003E   <>      U+00BB  ; >> -> RIGHT POINTING GUILLEMET

so we see that the mapping is

  • -- to en-dash –
  • --- to em-dash —
  • ' to right quote ’
  • '' to double right quote ”
  • ` to left quote ‘
  • `` to double left quote “
  • !` to inverted exclamation mark ¡
  • ?` to inverted interrogation mark ¿
  • ,, to German opening quotes „
  • << to opening guillemets «
  • >> to closing guillemets »

With LuaLaTeX some code with the same effect is executed; you can find it by looking for tlig in luaotfload-features.lua.

share|improve this answer
    
Note that as of version 2.4 of fontspec, the Ligatures=TeX option is activated by default. –  egreg Sep 3 at 9:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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