In the .otf fonts where they are present, the Contextual Alternate (calt) and Localized Forms (locl) functions work fine in LibreOffice.
Experiment: I create a quoteright.fr
glyph with a large bearing and impose a calt because quoteright
glyph in Italian and in French is replaced by quoteright.fr
glyph.
With LibreOffice the difference is evident: for the first line I set the Italian language, for the second line the English language (without bearing):
Instead with Xetex I can not enable these functions.
If I do not specify anything in the font features, the contextual substitution rule does not work.
If I enter Contextuals = Alternate
I receive the message:
Package fontspec Warning: OpenType feature 'Contextuals = Alternate' (calt) not
(fontspec) available for font 'GaramondPremPro' with script
(fontspec) 'Latin' and language 'Default'.
and again the contextual replacement rule does not work.
Here is Xetex (first line in Italian, second in English
with the following code:
\documentclass {article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Garamond Premier Pro}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{english}
\begin{document}
I'I N'P
\begin{english}I'I N'P\end{english}
\end {document}
What can you depend on? Is there an error or a lack in my code?
Thank you
PS
otfinfo -f recognizes only system-wide features, and not localized ones (neither calt nor locl), that are also present in the font if I check it with FontLab or FontForge:
samiel@darkstar:~/work$ otfinfo --features font.otf
aalt Access All Alternates
c2sc Small Capitals From Capitals
cpsp Capital Spacing
dnom Denominators
frac Fractions
kern Kerning
liga Standard Ligatures
lnum Lining Figures
numr Numerators
onum Oldstyle Figures
pnum Proportional Figures
smcp Small Capitals
sups Superscript
tnum Tabular Figures
zero Slashed Zero
PS2
I tried various possibilities. The following one:
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle,Language=Italian,RawFeature={+calt}]{Garamond Premier Pro}
\usepackage{polyglossia}
%\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{english}
\begin{document}
I'I N'P
\begin{english}I'I N'P\end{english}
\end{document}
produces the calt all over the document, not only for Italian and French languages (as in the font localized calt rule).
If I set
\setmainfont[Ligatures=TeX,Numbers=OldStyle,RawFeature={+calt}]{Garamond Premier Pro}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
the replacement is never produced
Added answer to wrong question:
I tried various possibilities. The following one:
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle,Language=Italian,RawFeature={+calt}]{Garamond Premier Pro}
\usepackage{polyglossia}
%\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{english}
\begin{document}
I'I N'P
\begin{english}I'I N'P\end{english}
\end{document}
produces the calt all over the document, not only for Italian and Frenc (as inthe font cal rule.
If I set
\setmainfont[Ligatures=TeX,Numbers=OldStyle,RawFeature={+calt}]{Garamond Premier Pro}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
the replacement is never produced
\setmainfont[Ligatures=TeX,Numbers=OldStyle,Language=Italian]{GaramondPremPro}
?