Bug 101174 - Enable means to change Formula Editor default font from OpenSymbol via Expert Configuration
Summary: Enable means to change Formula Editor default font from OpenSymbol via Expert...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Not Assigned
: 67152 111700 127414 127553 (view as bug list)
Depends on:
Blocks: 32362 Formula-Editor Fonts
  Show dependency treegraph
Reported: 2016-07-28 13:17 UTC by V Stuart Foote
Modified: 2019-09-19 04:03 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description V Stuart Foote 2016-07-28 13:17:04 UTC
Current the Math Formula Editor is hard coded to use OpenSymbol [1] and assigned variables FONTNAME_MATH and then as FNTNAME_MATH [2] and used as FNT_MATH [3][4] 

There are a number of high quality font faces that have complete coverage of the Greek and Character Like symbols that the formula editor makes use in its specialized Symbols catalog, e.g. Cambria Math, Asana Math, STIX, etc. Any of which might be preferred by users as functional replacements to the bundled OpenSymbol font.

Suggest an ability in Expert Configuration dialog to change the font assigned to FONTNAME_MATH, or used as FNT_MATH would be useful. It might be grouped with the other org.openoffice.Office.Math StandardFormat stanzas.

This would be as an alternative to the general Tools -> Options -> Fonts: Replacement Table GUI where the replacement is global for all use of a font, OpenSymbol in this case. And if it proves popular, the ability to change the default font could later be added to the GUI settings panel for Math.

[1] http://opengrok.libreoffice.org/xref/core/starmath/inc/types.hxx#24
[2] http://opengrok.libreoffice.org/xref/core/starmath/inc/format.hxx#32
[3] http://opengrok.libreoffice.org/xref/core/starmath/source/format.cxx#74
[4] http://opengrok.libreoffice.org/search?q=FNT_MATH&project=core
Comment 1 V Stuart Foote 2016-07-28 17:12:22 UTC
Definitions for the other Greek symbols %alpha... %gamma in the Formula Editor symbol catalog look to be defined in:


Glyphs refered to by decimal equivs of their Unicode codepoints, but since the .XCU has a hardcoded OpenSymbol font Name attribute set it may impact ability to have a simple attribute change set from Expert Configuration.
Comment 2 Khaled Hosny 2016-11-11 23:34:47 UTC
Just changing the font is not enough, may symbols are hardcoded to use PUA code points from OpenSymbol, so changing the font will give you garbage. This needs to be fixed first.
Comment 3 V Stuart Foote 2016-11-12 00:46:41 UTC
OK, so IIUC use of the font replacement table work because the glyph has already been selected and then the replacement can proceed?

Should the OpenSymbol font be reworked to eliminate any direct use of the PUA defined glyphs?
Comment 4 Mike Kaganski 2016-11-12 07:19:37 UTC
I'm not sure it's possible. To have correct display, glyph's size should be specifically chosen to be usable stretched, stacked etc. Also, we stretch characters where they should be composed of a number of parts to display OK (braces/parens, etc) - now stretching makes glyphs thin etc. Fixing this requires changing current composition of glyphs. And if we go this route, then substitute should have these glyph parts available at the same codepoints as well.
Comment 5 V Stuart Foote 2016-11-12 16:31:48 UTC
Sure, and bug 32362 suggests the formula editor must go this direction.
 but doesn't all of this require we have the U+239B -> U+23B7 glyphs available to use? Not yet the case in OpenSymbol, but common in other symbol fonts.
Seems like we should dump any hard coded use of OpenSymbol's PUA glyphs, and use Unicode near term in preparation.

And once we move to using the appropriate Unicode glyps, doing proper OpenType Math table shaping seems advisable as in bug 103680.

Problem of the PUA assignment aside, an effort here to provide UI to be able to change the default font seems reasonable, and would survive any refactoring of the sm math internals.
Comment 6 john 2017-03-15 06:31:43 UTC
My comment would be that it's essential that we be able to change the font of our formula, independent of this immediate issue with the font metrics of OpenSymbol. Agree with Stuart's comments about the need to move away from any/all hard-coded dependencies on a particular font. But in the interim -- switch to a well-behaved font instead!!
Comment 7 V Stuart Foote 2017-05-08 23:50:04 UTC
*** Bug 67152 has been marked as a duplicate of this bug. ***
Comment 8 V Stuart Foote 2017-08-11 19:09:48 UTC
*** Bug 111700 has been marked as a duplicate of this bug. ***
Comment 9 Volga 2017-08-11 19:36:09 UTC
(In reply to V Stuart Foote from comment #5)
> Seems like we should dump any hard coded use of OpenSymbol's PUA glyphs, and
> use Unicode near term in preparation.
I suggest we can replace such hard coded PUA code points to Unicode equivalences firstly, and then create a converter to replace them when LO imported a formulae including such glyphs.
Comment 10 V Stuart Foote 2019-09-07 02:37:30 UTC
*** Bug 127414 has been marked as a duplicate of this bug. ***
Comment 11 V Stuart Foote 2019-09-15 16:17:41 UTC
*** Bug 127553 has been marked as a duplicate of this bug. ***