fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

`\defaultfontfeatures[not \ttfamily]{...}`

Open wspr opened this issue 11 years ago • 0 comments

From Qing Lee in a comment on another bug:

I think it is very useful to add

\defaultfontfeatures[not \rmfamily]{...}

If this feature is availbale, I can say

\defaultfontfeatures[not \ttfamily]{Ligatures=TeX}

I added a value NoTeX for option Ligatures to handle it without this not feature:

\keys_define:nn { fontspec }
  {
    Ligatures / NoTeX .code:n =
      {
%<xetex>        \fontspec_update_fontid:n { -map:tex-text }
%<luatex>        \fontspec_update_fontid:n { -tlig-trep }
        \tl_if_empty:NF \l_fontspec_rawfeatures_sclist
%<*xetex>
          {
            \seq_set_split:NnV \l_@@_tmp_seq { ; } \l_fontspec_rawfeatures_sclist
            \seq_set_filter:NNn \l_@@_tmp_seq \l_@@_tmp_seq
              { ! \str_if_eq_p:nn { mapping=tex-text } { ##1 } }
            \tl_gset:Nx \l_fontspec_rawfeatures_sclist
              { \seq_use:Nn \l_@@_tmp_seq { ; } }
          }
%</xetex>
%<*luatex>
          { \fontspec_update_featstr:n { -tlig; -trep } }
%</luatex>
      }
  }

and I have to say

\defaultfontfeatures{Ligatures=TeX}
....
\setmonofont[Ligatures=NoTeX,WordSpace={1,0,0},...]{...}

So if you implement the not feature for \defaultfontfeatures, it will make our life easier. :-)

wspr avatar Apr 25 '14 13:04 wspr