使用 Fontspec 将 hairspace + hyphen 作为连字符

使用 Fontspec 将 hairspace + hyphen 作为连字符

我想使用以下连字符组合:发际线 + 连字符,以便清楚但谨慎地区分连字符和除法。

传统方式(使用其他字符,如 ≈)不适用于我使用的字体,因为字体没有适合这种用途的视觉效果。我使用 Fontspec 和 Lualatex,能够更改连字符,但文档说

它接受三种类型的输入,这些输入根据一些简单的规则进行选择。如果输入是字符串 None,则此字体将禁止使用连字符。如果输入是单个字符,则使用此字符。最后,如果输入的长度超过单个字符,则它必须是您想要的连字符的 UTF-8 插槽号。

有没有办法使用多个字符来定义连字符?


第一次编辑:

这是我想要第一个连字符的 MWE(短腿)不加字距,不像第二个(在Supercalifragilisticexpialidocious):

\documentclass[a5paper,12pt]{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{filecontents,fontspec,microtype}
\begin{filecontents*}{garamond.fea}
languagesystem DFLT dflt;
languagesystem latn dflt;

feature kern {
  pos hyphen' <500 0 0 0>;
} kern;
\end{filecontents*}
\setmainfont{Garamond}[
  FeatureFile={garamond.fea}]
\frenchspacing

\begin{document}

\Large
The short-legged vulture is Supercalifragilisticexpialidocious.

\addfontfeature{HyphenChar=8776}

The letter used for hyphenation may be chosen with the HyphenChar
feature. It takes three types of input, which are chosen according to
some simple rules. If the input is the string None, then hyphenation
is suppressed for this font. If the input is a single character, then
this character is used. Finally, if the input is longer than a single
character it must be the UTF-8 slot number of the hyphen character
you desire.
\end{document}

相关内容