4

I would like to use for hyphen character the combination: hairspace + hyphen, in order to clearly but discreetly distinguish hyphenation from division.

The traditionnal way (using another character, like ≈) is not an option with the font I'm using, which have nothing that fits visualy for this use. I'm using Fontspec with Lualatex and have been able to change the hyphencharacter, but the documentation says

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.

Is there a way to use more than one char to define hyphen char?


1st edit:

Here's a MWE where I want the first hyphen (short-legged) unkerned, unlike the second one (in 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}
  • 1
    You could add some kerning (with a feature file) to the hyphenchar. – Ulrike Fischer Apr 13 '15 at 11:05
  • 1
    @UlrikeFischer: I think OpenType processing is applied much earlier than the hyphenation, so the kerning is unlikely to get applied. – Khaled Hosny Apr 13 '15 at 12:00
  • 1
    @KhaledHosny is right: see my MWE. – KO the typo Apr 13 '15 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.