ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Yaroslav Beltukov via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Yaroslav Beltukov <ybeltukov@gmail.com>
Subject: Font substitution for extensible symbols
Date: Thu, 2 Feb 2023 02:11:17 +0300	[thread overview]
Message-ID: <CAFVMVnPxMh4Orwz5bkK9sZRW0AN2YeNS0bQjHrOT2zBa8GPw6Q@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1911 bytes --]

Good day everyone,

I'm trying to replace the math radical symbol (with all its variants) in
one font with another one. Some fonts have too few radical symbols of
different sizes, which results in enormous spacing in radicals.

However, there is a bug in the new font replacement mechanism. Here is MWE:

% 0x221A is the radical symbol
\definefallbackfamily [MainFace] [mm] [TeX Gyre Pagella Math] [force=yes,
range=0x221A]
\definefontfamily     [MainFace] [tf] [Cambria] % or [XITS]
\definefontfamily     [MainFace] [mm] [Cambria Math] % or [XITS Math]
\setupbodyfont [MainFace]
\starttext
\startformula

\sqrt{\frac{1}{2}}\dorecurse{15}{+\sqrt{\blackrule[width=10pt,height=#1pt,depth=#1pt,color=gray]}}
\stopformula
\startformula
  \sqrt{\blackrule[width=10pt,height=100pt,depth=100pt,color=gray]}
\stopformula
\stoptext

It works in MKIV but it gives the following error in the latest LMTX:

...mkxl/math-vfu.lmt:675: attempt to get length of a nil value (global 'hp')

It is caused by the following loop in math-vfu.lmt:

        local pv = olddata.parts
        if pv then
            pv = fastcopy(pv)
            newdata.parts = pv
            for i=1,#hp do
                local pvi = pv[i]
                ...

One can see that #hp should be #pv. After this correction, the error
disappears and we get different sizes of radicals from the new font.
However, now the extended version of the radical does not work. Actually,
this loop is devoted to copying the parts of the extended symbol, and it
does not work as expected. Obviously, there is something deeper than the
correction of the typo. The same behaviour is for other extensible symbols
(e.g. parentheses).

I hope this issue can be resolved. A more deeper understanding is required
here.

Best regards,
Yaroslav

P.S. sometimes I get the following output. Maybe it is related:
otf reader      > cff >     unknown local call ?, case 1 : [] n=0

[-- Attachment #1.2: Type: text/html, Size: 3936 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

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

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

                 reply	other threads:[~2023-02-01 23:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFVMVnPxMh4Orwz5bkK9sZRW0AN2YeNS0bQjHrOT2zBa8GPw6Q@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=ybeltukov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).