[NTG-context] bidi + protrusion issue in LMTX

2020-03-02 Thread Joseph
Hi, I found that in some cases bidi text seems to inhibit protrusion feature in text typesetting in LMTX (works fine with luatex 1.10).MWE below (difference is in first paragraph, second is for comparison and is same in both): \language[fr]\mainlanguage[fr] \definefontfamily[mainfont][serif][EBGaramond][features={protrusion=quality, expansion=quality}] \setupbodyfont[mainfont, 14pt] \def\HSize{108.78508pt} % hardcoded from page layout \starttext \hsize=\HSize\setupalign[normal, hanging, morehyphenation, hz, verytolerant, stretch] ou/ vehement car {\setupalign[r2l]mehev} se prent aucunesfoispour hault/ excellent/ & puissant. ou/ vehement car vehem se prent aucunesfoispour hault/ excellent/ & puissant. \stoptext Best Joseph 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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
___


Re: [NTG-context] Left hanging hyphen

2020-03-02 Thread Wolfgang Schuster
On Mon, 2 Mar 2020 12:22:26 +0100
Tomas Hala  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

\startluacode

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

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

\stopluacode

\definebreakpoints [czcompound]

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

\startsetups [czech]
  \setbreakpoints [czcompound]
\stopsetups

\setuplanguage
  [cz]
  [setups=czech]

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

\setupalign [hanging]

\mainlanguage [cz]

\showframe [text] [text]

\starttext

\hsize=0pt

modro-zelený

\stoptext
 end example

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

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
___


[NTG-context] Left hanging hyphen

2020-03-02 Thread Tomas Hala
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?

Tomáš


% for repeating the hyphen
\definebreakpoints[czcompound]
\definebreakpoint[czcompound][-][nleft=3,nright=3,type=4]
\def\mylanguage{cs} \appendtoks \ifx\mylanguage\currentlanguage 
\setbreakpoints[czcompound] \else \resetbreakpoints \fi \to\everylanguage 
\def\mylanguage{sk} \appendtoks \ifx\mylanguage\currentlanguage 
\setbreakpoints[czcompound] \else \resetbreakpoints \fi \to\everylanguage

\starttext\showframe
\hsize1dd
modro-zelený  %blue-green
\stoptext

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

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
___