I would like to use OpenType Vollkorn with xetex
but its "1" causes me problems. It has an alternate glyph (whose glyph name is "one.ss01"), which I can trigger via StylisticSet={1}
. But this also changes other characters:
otfinfo -g Vollkorn-Regular.otf | grep "ss01"
J.ss01
Jcircumflex.ss01
Q.ss01
uni1E9E.ss01
a.ss01
aacute.ss01
abreve.ss01
acircumflex.ss01
adieresis.ss01
agrave.ss01
amacron.ss01
aogonek.ss01
aring.ss01
atilde.ss01
g.ss01
gbreve.ss01
gcircumflex.ss01
gcommaaccent.ss01
gdotaccent.ss01
one.ss01
three.ss01
zero.lf.ss01
three.lf.ss01
seven.lf.ss01
zero.tf.ss01
three.tf.ss01
seven.tf.ss01
slash.ss01
I don't want the alternate "a". I could use locally \XeTeXglyph
as in this example:
\documentclass{article}
\usepackage{fontspec}
% http://vollkorn-typeface.com/
\setmainfont{Vollkorn}[%StylisticSet={1},
ItalicFont={* Italic}, BoldFont={* Bold}, BoldItalicFont={* Bold Italic}]
% \def\VollkornFamilyName{Vollkorn(0)}
% utiliser \XeTeXglyph 381 en testant \f@family ?
% non je ne vais pas rendre le 1 actif !
% et c'est \XeTeXglyph 309 en italic
\begin{document}
1234567890
\bfseries 1234567890
\itshape 1234567890
\mdseries 1234567890
\normalfont
\XeTeXglyph 381 234567890
\bfseries \XeTeXglyph 381 234567890
% need to change glyph number
\itshape \XeTeXglyph 309 234567890
\mdseries \XeTeXglyph 309 234567890
\end{document}
% Local Variables:
% TeX-engine: xetex
% End:
But I need to apply this on a document which is generated from other sources not manually typed and it seems somewhat dangerous to make the 1
active, with the idea that it would test for the font family and font shapes,etc… and insert the suitable glyph via \XeTeXglyph
or just \string1
.
as expected making the 1 active had many issues, among them that \XeTeXglyph
can not be used in math mode, or in a \csname
— just not an option
Is there a solution for using one.ss01
glyph without activating the full StylisticSet
?
I checked the fontspec
manual and discovered the notion of CharacterVariant
but there is no such features in that OpenType font:
Fonts$ otfinfo -f Vollkorn-Regular.otf
aalt Access All Alternates
calt Contextual Alternates
case Case-Sensitive Forms
cpsp Capital Spacing
dlig Discretionary Ligatures
dnom Denominators
frac Fractions
kern Kerning
liga Standard Ligatures
lnum Lining Figures
mark Mark Positioning
numr Numerators
onum Oldstyle Figures
ordn Ordinals
pnum Proportional Figures
salt Stylistic Alternates
ss01 Stylistic Set 1
sups Superscript
tnum Tabular Figures
Best Answer
The following Python script for FontForge creates
It generates files
Vollkorn-Regular-ss02.otf
, ... with an additional stylistic set 02 for the replacement of glyphone
withone.ss01
and which can be activated:Result with XeLaTeX: