Bug 157520

Summary: Misplaced brackets when using a different mathematical font
Product: LibreOffice Reporter: RGB <rgb.mldc>
Component: Formula EditorAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: khaled, miguelangelrv, stephane.guillou, vsfoote
Priority: medium    
Version: 24.2.0.0 alpha0+   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 135859    
Attachments: Screenshot comparing brackets with OpenSymbol vs. KpMath
Write file with three Math object presenting the problem

Description RGB 2023-09-29 20:14:33 UTC
Created attachment 189897 [details]
Screenshot comparing brackets with OpenSymbol vs. KpMath

LibreOffice Math 24.2 adds the possibility to change the mathematical font used for symbols. When selecting a font different from OpenSymbol, parenthesis and brackets are misplaced, as you can see from the attached screenshot. (The screenshot uses KpMath, but any other mathematical font gives the same result).

Tested with

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 655045d018937b1323f4d576214a50d29e15433d
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 1 m_a_riosv 2023-09-30 01:52:41 UTC
Please can you attach a sample, your code doesn't work for me.
Comment 2 RGB 2023-10-01 15:22:42 UTC
Created attachment 189932 [details]
Write file with three Math object presenting the problem

[Notice that for the attached file example to work you need to install the KpFonts-otf font family, specially KpMath-Regular.otf 

https://ctan.org/pkg/kpfonts-otf

Download the zip file, uncompress it and in the Fonts folder you'll find all the relevant files.]

The attached odt file includes three Math objects, one using OpenSymbol as mathematical font, and the other two using KpMath. Notice that the displaced brackets get cut-off in the second object, so adding a ^{ } at the end is needed to display the full object.
Comment 3 Stéphane Guillou (stragu) 2023-10-13 21:15:56 UTC
Thanks for the report.
Reproduced in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e9374f74385d7dfe77d1902d3d82af20143bc775
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Khaled, what do you think?
Comment 4 V Stuart Foote 2023-10-14 01:32:00 UTC
Confirmed bad bracket stretch for a node of a nested 7 element stack {} within left[ and right] brackets with each of: Libertinus Math, Cambria Math, and STIX Two Math as compared to the node sized for OpenSymbol.

left[ stack{ <?>#<?>#<?>#<?>#<?>#<?>#<?> } right]

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7f69bca41c5034207ba9170420f6b3b214121a7b
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded