a bug in typoduc.lmt?
Hello, consider the following: -------------------------------------------- \setuppapersize[A4] \mainlanguage[arabic] \setupdirections[bidi=global, method=unicode] \setupbodyfontenvironment[default][em=italic] \definefontfamily [myfont][serif][Amiri] [features=arabic] \definefontfamily [myfont][mono] [Latin Modern Mono] \setupbodyfont [myfont] \setuppagenumbering[state=none] \starttext بى 19 az 29 تى 19 29 39 ثى 49-59 سى 69/79 شى 19.29 صى 39,49\stoptext -------------------------------------------- I'm not sure if I get the expected out put. is it a problem with my setup, my expectation, or a bug in typo-duc.lmt? I attached the out put I get (result.pdf), and what I expect to get (expected.pdf). thanks, Udi
On 11/5/2025 10:24 AM, Udi Fogiel via ntg-context wrote:
\setuppapersize[A4] \mainlanguage[arabic] \setupdirections[bidi=global, method=unicode]
\setupbodyfontenvironment[default][em=italic]
\definefontfamily [myfont][serif][Amiri] [features=arabic] \definefontfamily [myfont][mono] [Latin Modern Mono] \setupbodyfont [myfont]
\setuppagenumbering[state=none]
\starttext
بى 19 az 29 تى 19 29 39 ثى 49-59 سى 69/79 شى 19.29 صى 39,49 \stoptext
you need to set up alignment \setuppapersize[A4] \mainlanguage[arabic] \setupdirections[bidi=global,method=unicode] \definefontfamily [myfont][serif][Amiri] [features=arabic] \definefontfamily [myfont][mono] [Latin Modern Mono] \setupbodyfont [myfont] % \setupalign[normal,righttoleft,tolerant] \starttext \startTEXpage[offset=3ts,frame=on,align={normal,righttoleft,tolerant}] بى 19 az 29 تى 19 29 39 ثى 49-59 سى 69/79 شى 19.29 صى 39,49 \stopTEXpage \stoptext -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Wednesday, November 5th, 2025 at 12:27 PM, Hans Hagen via ntg-context
you need to set up alignment
\setuppapersize[A4]
\mainlanguage[arabic]
\setupdirections[bidi=global,method=unicode]
\definefontfamily [myfont][serif][Amiri] [features=arabic] \definefontfamily [myfont][mono] [Latin Modern Mono] \setupbodyfont [myfont]
% \setupalign[normal,righttoleft,tolerant]
\starttext
\startTEXpage[offset=3ts,frame=on,align={normal,righttoleft,tolerant}] بى 19 az 29 تى 19 29 39 ثى 49-59 سى 69/79 شى 19.29 صى 39,49 \stopTEXpage
\stoptext
But it still gives me the same, unexpected, result, or am I missing something? Udi
On Wednesday, November 5th, 2025 at 12:42 PM, Udi Fogiel via ntg-context
On Wednesday, November 5th, 2025 at 12:27 PM, Hans Hagen via ntg-context ntg-context@ntg.nl wrote:
you need to set up alignment
\setuppapersize[A4]
\mainlanguage[arabic]
\setupdirections[bidi=global,method=unicode]
\definefontfamily [myfont][serif][Amiri] [features=arabic] \definefontfamily [myfont][mono] [Latin Modern Mono] \setupbodyfont [myfont]
% \setupalign[normal,righttoleft,tolerant]
\starttext
\startTEXpage[offset=3ts,frame=on,align={normal,righttoleft,tolerant}] بى 19 az 29 تى 19 29 39 ثى 49-59 سى 69/79 شى 19.29 صى 39,49 \stopTEXpage
\stoptext
But it still gives me the same, unexpected, result, or am I missing something?
Udi
Hei Hans, I've done some digging in the code, and noticed that the list of nodes are unbalanced with regards to dir nodes as a result of the code in typo-duc. I think the main problem is that insert_dir_points can only insert one dir point at each entry, but sometimes several closures can happen at a time. In addition there are a couple of nil variables, and variables shadowing others. I attached a patch for typo-duc.lua (which is almost identical to typo-duc.lmt). Thanks, Udi
participants (2)
-
Hans Hagen -
Udi Fogiel