On Mon, 2 Mar 2020 12:22:26 +0100
Tomas Hala <tomas.h...@mendelu.cz> wrote:

> Hi all,
> in composed words in Czech and Slovak languages, the hyphen must be repeated 
> at the beginning of the new line. How can I make it hanging at the left 
> margin?

1. You have to enable hanging punctuation which is missing in your example.

2. You have to create your own protrusion vector because the predefined vectors 
set hanging for hyphens only for the right margin.

The following example uses code shown in the fonts manual (fonts-mkiv.pdf) to 
create a custom protrusion vector:

%%%% begin example


fonts.protrusions.classes.tomas_hala = {
    vector = 'tomas_hala',
    factor = 1,

fonts.protrusions.vectors.tomas_hala = table.merged (
        [0x002D] = { 0.4, 0.7 }, -- hyphen


\definebreakpoints [czcompound]

\definebreakpoint [czcompound] [-] [nleft=3,nright=3,type=4]

\startsetups [czech]
  \setbreakpoints [czcompound]


\definefontfeature [default] [default] [protrusion=tomas_hala]

\setupalign [hanging]

\mainlanguage [cz]

\showframe [text] [text]




%%%% end example

If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net

Reply via email to