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.

I would like activate Libertine's discretionary and historical ligatures with ConTeXt and XeTeX compilation.

Currently, I'm using this:

\definetypeface[Libertine][rm][Xserif][Linux Libertine O]
\setupbodyfont[Libertine, 9pt]

\starttext
fi ffl ct st
\stoptext

Any ideas?

share|improve this question
add comment

1 Answer

The cheap solution: You can enable font features globally by adding them to the default feature set:

%% The “default” set is always active.
\definefontfeature [default] [default] [
  liga=yes,
  hlig=yes,
  dlig=yes,
]

\definetypeface[Libertine][rm][Xserif][Linux Libertine O]
\setupbodyfont[Libertine, 9pt]

\starttext
fi ffl ct st
\stoptext

For more precise control over when the ligatures are activated you will need a typescript. This lets you specify which feature sets are enabled for each type face individually. But you could as well turn ligatures off for, say, the bold face by requesting features=default in the relevant line. Below example applies the ligature set to all four serif faces:

%% 1. Create a feature set, inheriting the defaults.
\definefontfeature [extraligatures] [default] [liga=yes,script=latn,hlig=yes,dlig=yes]

%% 2. Map font files for Libertine to type faces, applying the “extraligatures” features.
\starttypescript [serif] [mylibertine]
    \definefontsynonym[Serif]           [file:LinLibertine_R]    [features=extraligatures]
    \definefontsynonym[SerifItalic]     [file:LinLibertine_RI]   [features=extraligatures]
    \definefontsynonym[SerifBold]       [file:LinLibertine_RB]   [features=extraligatures]
    \definefontsynonym[SerifBoldItalic] [file:LinLibertine_RBI]  [features=extraligatures]
\stoptypescript

% 3. Define corresponding type face identifier.
\definetypeface [mylibertine] [rm] [serif] [mylibertine] [default]

% 4. Use the font in the document.
\setupbodyfont[mylibertine]

% 5. Test all four defined styles.
\def\ligatest#1{\bgroup#1fi ffl ct st\egroup\par}
\starttext
  \processcommacommand[,\italic,\bold,\bolditalic]\ligatest
\stoptext

Output of above snippet.

NB: Xetex neither has good support in ConTeXt nor is it widely used. You might consider switching to MkIV which comes with greatly improved font handling facilities and is actively developed.

share|improve this answer
add comment

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.