Problem with STIX Math font

General TRichView support forum. Please post your questions here
Post Reply
Vitalii
Posts: 55
Joined: Sat Oct 20, 2018 2:55 pm

Problem with STIX Math font

Post by Vitalii »

Hi, I have a problem with the "STIXTwoMath-Regular" math font. It is a very common and functional font. But when I try to use it (just select from ComboBox in the Equation Editor), I get AV.

I can't attach the font to this post, it's 819 kB. But you can download it freely here:
https://github.com/stipub/stixfonts/tre ... static_otf
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Problem with STIX Math font

Post by Sergey Tkachenko »

I cannot reproduce this problem.

Do you use the newest version of TRichView?

Can you send a call stack at the moment of exception?

(Compile your application with stack frames and without optimization (Project | Options, Building | Delphi Compiler | Compiling page).
When an AV happens, open call stack window ( View | Debug Windows | Call stack), select all (Ctrl+A), copy (Ctrl+C))
Vitalii
Posts: 55
Joined: Sat Oct 20, 2018 2:55 pm

Re: Problem with STIX Math font

Post by Vitalii »

Yes, I am attaching the ZIP. The archive contains a test application and screenshots.
I use the latest version of RV.
And here I recorded the sequence of my actions on video:
https://dystlab.store/download/gftruiw/ ... 120859.wmv
Attachments
test.zip
Delphi Project + Screenshots
(157.82 KiB) Downloaded 244 times
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Problem with STIX Math font

Post by Sergey Tkachenko »

Sorry, I still cannot reproduce error, even in your project.
Since AV happens in Adit Math Engine code, I forwarded this question to its developer.

As I can see, this error happens on memory allocation. Do you have some custom memory manager installed in Delphi?
Vitalii
Posts: 55
Joined: Sat Oct 20, 2018 2:55 pm

Re: Problem with STIX Math font

Post by Vitalii »

Sergey Tkachenko wrote: Sat Jan 28, 2023 8:02 pm Do you have some custom memory manager installed in Delphi?
I don't use custom memory managers, but If we need a more detailed analysis, I am ready.
Vitalii
Posts: 55
Joined: Sat Oct 20, 2018 2:55 pm

Re: Problem with STIX Math font

Post by Vitalii »

I experimented a bit and this is what I found. The STIX font set includes several math fonts:
- STIXTwoMath-Regular.otf (from the "fonts > static_otf" subfolder, 819 KB)
- STIXTwoMath-Regular.ttf (from the "fonts > static_ttf" subfolder, 1483 KB)

Both of these fonts result in an error (AV). But this font worked fine:
- STIXTwoMath-Regular.input.ttf (from the "source" subfolder, 1099 KB).

Maybe you used this last version of font (STIXTwoMath-Regular.input.ttf) and that's why you didn't get AV?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Problem with STIX Math font

Post by Sergey Tkachenko »

AME developer suggested to comment the following code in RVMathTable:

Code: Select all

      if GlyphInfo.MathKernInfo > 0 then
        begin
          KernInfo := PMathKernInfoRec(NativeUInt(GlyphInfo) + GlyphInfo.MathKernInfo);
          KernInfo.SwapTable;
          KernInfo.CopyTo(FGlyphInfo.KernInfo);
        end;
(He said that free version of AME has a bug in processing MathKernInfo, and it is not used in it anyway)
Vitalii
Posts: 55
Joined: Sat Oct 20, 2018 2:55 pm

Re: Problem with STIX Math font

Post by Vitalii »

I commented the code and tested AME's solution. The fonts "STIXTwoMath-Regular.otf" and "STIXTwoMath-Regular.ttf" failed anyway (now the AV appears in a different place). It seems to me that the engine does not work properly with some characters, because the font "STIXTwoMath-Regular.input.ttf" works correctly. I will use it for now.

And what does "free version of AME has a bug" mean? Doesn't the paid version have this bug?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Problem with STIX Math font

Post by Sergey Tkachenko »

Sorry, I do not know, I even cannot reproduce this bug: for me, the free version (included in TRichView) works with all math fonts that I have installed.
You can contact AME developer, Denis Sletcov,
math (at) aditmath.com
Post Reply