Bug 157520 - Misplaced brackets when using a different mathematical font
Summary: Misplaced brackets when using a different mathematical font
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula
  Show dependency treegraph
 
Reported: 2023-09-29 20:14 UTC by RGB
Modified: 2023-10-14 01:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot comparing brackets with OpenSymbol vs. KpMath (37.73 KB, image/png)
2023-09-29 20:14 UTC, RGB
Details
Write file with three Math object presenting the problem (23.33 KB, application/vnd.oasis.opendocument.text)
2023-10-01 15:22 UTC, RGB
Details

Note You need to log in before you can comment on or make changes to this bug.
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