Hi Hans (and other ConTeXt experts),

the following sample shows miscalculation for the `/Rect` of link
annotations with LMTX in current latest (2026.07.06 13:29).

  \setuppapersize[A7]
  \setupbodyfont[100pt]
  \setupinteraction[state=start, style=, color=, contrastcolor=,]
  \enabledirectives[references.border=red]
  \setuppagenumbering[location=,]
  \starttext
  \goto{g}
       [url(https://contextgarden.net)]
  \dontleavehmode
  \startMPcode
    draw textext("\goto{g}
       [url(https://contextgarden.net)]") ;
  \stopMPcode

  \pagereference[æb]
  \scale[height=66.6pt]{\at[æb]}
  \at[æb]
  \stoptext

Both links have their rectangle placed fine with LuaTeX from the same
latest.

Given that a `/Rect` has four values (bl-x, bl-y, tr-x, tr-y [bottom
left and top right]), in the misplaced link from the first page, the
actual value of bl-y should be the one from tr-y, and tr-y should have
the actual value bl-y plus 1st.

In the misplaced link from the second page, the actual value of bl-y
should be the one from tr-y minus 1sd and, tr-y should have its own
original value plus 1sh (or the actual value bl-y plus 1st [which should
be the same]).

I attach a PDF document that I corrected by hand (including an
explanation, basically to myself).

I don’t know what is triggering the miscalculation in these particular
cases in LMTX (I can recall your explanation that PDF has y-coordinate
from top to bottom of the page, while TeX has it from bottom to top).

Could you take a look at these issues?

Many thanks for you help,

Pablo

Attachment: miscalculated-Rect.pdf
Description: Adobe PDF document

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to