Starthanging inside reverse paragraph incorrectly places distance
Aryeh Zapinsky <[email protected]> Fri, 3 Jul 2026 07:59:26 -0400
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <CAD+MA4vBLShVNn0g_=PKwmhptXoyo4Z4EM=mfPyy7KnGu-eawg@mail.gmail.com> |
Hi,
It seems like the distance option in \starthanging puts a variable amount
of space between the hanging content and the wrapping text. When using r2l,
this seems to work as intended. When using in a paragraph that has
direction=reverse set, it appears the distance is placed between the start
of the paragraph and the hanging content and pushes up against the wrapping
text. Anything to do to fix this?
Also tangentially, when using r2l, location has to be set to right to place
it in the correct location on the right side of the text, while using start
paragraph where direction is reverse, the location has to be set to right
to place it on the right side of the text.
Minimal example below and screenshots attached. Any help is appreciated.
-- Aryeh
*Minimal example:*
\definefontfeature[minimal][hebrew]
\starttypescript [serif] [hebrew]
\definefontsynonym [Serif]
[file:/workspaces/context_lmtx/context_2/build_from_cmake_2/context_from_scratch/tex/texmf-fonts/firago/FiraGO-Regular.ttf][features=minimal]
\definefontsynonym
[SerifBold][file:/workspaces/context_lmtx/context_2/build_from_cmake_2/context_from_scratch/tex/texmf-fonts/firago/FiraGO-Regular.ttf][features=minimal]
\stoptypescript
\definetypeface [hebrew] [rm] [serif] [hebrew]
\definetypeface [hebrew] [ss] [serif] [hebrew]
\setupbodyfont[hebrew, 20pt]
\setupalign[r2l]
\setupdirections[bidi=global, method=unicode]
\definegridsnapping[tolerant]
\setuplayout
[grid=normal]
\starttext
\startuseMPgraphic{letter_w}
picture q;
q := outlinetext(\MPstring{hebrew_letter}) scaled 3;
for i within q:
j := j + 1;
draw pathpart i withpen pencircle scaled 2;
endfor;
\stopuseMPgraphic
\starttexdefinition hangingCharacter #1
\setMPtext{hebrew_letter}{#1}
\hbox{\useMPgraphic{letter_w}}
\stoptexdefinition
\starthanging[distance=3*ex,location=left]{\snaptogrid\vbox{\hangingCharacter{חַ}}}
י ה' וּבָרוּךְ צוּרִי בַּה' תִּתְהַלֵּל נַפְשִׁי כִּי ה' יָאִיר נֵרִי
בְּהִלּוֹ נֵרוֹ עֲלֵי רֹאשִׁי %
\stophanging
\blank
\defineparagraphs[ChaiHashemPar][n=2, direction=reverse]
\startChaiHashemPar
\startframedtext[width=.5\textwidth,align=flushright,strut=none]
\starthanging[distance=3*ex,location=right]{{\hangingCharacter{חַ}}}
י ה' וּבָרוּךְ צוּרִי בַּה' תִּתְהַלֵּל נַפְשִׁי כִּי ה' יָאִיר נֵרִי
בְּהִלּוֹ נֵרוֹ עֲלֵי רֹאשִׁי %
\stophanging
\stopframedtext
\ChaiHashemPar
\startframedtext[width=.5\textwidth,align=flushright,strut=none]
\starthanging[distance=3*ex,location=right]{{\hangingCharacter{יִ}}}
שְׁלַח מַלְאָכוֹ לְפָנָי
לְלַוֹּתִי לְוָיָה
בְּכוֹס יְשׁוּעוֹת אֶשָּׂא פָנָי
מְנָת כּוֹסִי רְוָיָה
\stophanging
\stopframedtext
\stopChaiHashemPar
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
starthanging_in_r2l.png
(image/png, 13.8 KB) - not displayed
starthanging_inside_paragraph.png
(image/png, 41.3 KB) - not displayed