ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Font substitution for extensible symbols
@ 2023-02-01 23:11 Yaroslav Beltukov via ntg-context
  0 siblings, 0 replies; only message in thread
From: Yaroslav Beltukov via ntg-context @ 2023-02-01 23:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Yaroslav Beltukov


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-01 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 23:11 Font substitution for extensible symbols Yaroslav Beltukov via ntg-context

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).