This reverts commit 378dd9025e.
Reason for revert: The user report that resulted in the first revert was bogus and based on user misunderstanding
Change-Id: I511386fb66bb1026da46cef9939c7108f9516318
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183423
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Use the document format to resolve the font and style of the symbol.
This makes the symbols use the current document font, as well as apply
settings like GreekCharStyle.
Change-Id: I668e582704b7e011e032f8b9e1dfb509e0d00d3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157348
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
It no longer exists upstream, probably renamed to Noto Sans Mono, so if
it is going to be a new font we are better off dropping it entirely.
Change-Id: I8d727c2419a6081b37802324ff115611bce3c9dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157282
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
When saving symbols we use the non-localized name, but iGreek symbols
are a bit of a hack since they are added at runtime and don’t have
localizations of there own but use the Greek symbols names with an “i”
prefix.
Instead of looking directly for localized names, we now go through the
symbol manager that already knows about iGreek and use the export name
of the symbol. We have to also make sure the iGreek symbols has
non-localized export name.
Change-Id: Ia3e38579abba56ae12ade126f564f8c6f9c3229a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157137
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
If a setting is missing, e.g. math font when reading old file, we would
set it to an empty font instead of using the default.
Regression from:
commit 626d17a8ec
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Thu Aug 31 14:54:52 2023 +0300
tdf#143213: Fix reading math font settings from file
Change-Id: Ib8b3cede3d4bea7e03a146b7e5f39ad2c7dfa363
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157094
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Using twips everywhere and not rounding to pixels seems to improve
positioning (at least on hipdi displays). Hopefully the issue that
required rounding is no longer relevant.
Change-Id: I0ee4a4453b2a3d8e06be56d586761f7960a2d4d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157044
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
We want to use the current format when using the symbol in a document,
and fallback for stabdard format when rendering the symbol in symbols
dialog.
Fixup for the following two commits:
commit f28b043b4e
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Mon Sep 18 19:00:02 2023 +0300
starmath: Fix editing symbols in the Symbols Catalogue
commit 32d2e001bb
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Tue Sep 12 18:35:46 2023 +0300
tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols
Change-Id: Id3730749a49015120ecf9719027f932fd90c605a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157043
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
We are not ready to get rid of it (e.g. undo does not work when it is
hidden). This flips the default introduced in:
commit e9cc014be4
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Tue Sep 12 16:41:37 2023 +0300
starmath: Hide editing window by default and add a menu item to show
Change-Id: If84b25d186c8d133a9fa5cfc0c3d91162c66b389
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157004
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Needed to fix a punch of code to work with UTF-16 not just UCS-2 (in
other words, handle surrogate pairs).
Change-Id: Idd7aa823349a032f20f37abbb588856afbc548d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156994
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
The radical glyph in OpenSymbol is aligned to the font ascender, which
is not essentially true for other fonts, so we now use the bounding
rectangle of the glyph to get accurate positioning.
Change-Id: I83c21cd21de25f23f96f819e168f43aa9ab22351
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156926
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Since originally all editing happened in the edit window, it was made to
grab focus instead of the math widget, but we don’t want that anymore
when inline editing is enable as we want to edit everything in the math
widget.
This also removes ancient test that is now failing. We will eventually
drop the edit window altogether.
Change-Id: Ia1628a454bbbdd923ff582564eca1ab4ec830f38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156579
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Invalidate the slots explicitly instead of implicitly by updating the
edit window.
Followup to:
commit 065609f86f
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Mon Sep 4 13:22:04 2023 +0300
starmath: Make cut/copy/paste buttons work with inline editing
Change-Id: If0648c249d6145475202e1a48364d7fe142a5e35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156674
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
When converting node tree creating with visual editor back to text for
the command editor, try to always insert brackets around binary
expressions. It might look redundant at times but it is safer, and the
code is not supposed to be edited by hand anymore so doesn’t have to
look pretty.
Change-Id: Ifff574494c9e8f8b948e432f6832d88c334aba00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156640
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Choosing which code path based on which widget has focus is not a very
good idea, and leads to unreliable UI tests as each code path inserts
the text slightly differently (one code path inserts plain text then
parses the whole equation again, while the other parses the new text
then inserts the parsed node directly).
Change-Id: Ib2ca942c537e466f6ff100be7f95adaead99f1d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156578
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Check for visual cursor selection when in inline editing mode, and update edit
window when updating visual cursor.
Change-Id: Id1a259b67db47eea0b36b55d08ef5dc5f8aa8246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156513
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Respect IsRightToLeft property and render accordingly.
This also fixes math rendering in RTL UI, which was incorrectly rendered RTL.
Change-Id: Id8520930f09a21daa1c70e40a765ac25572ea994
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155738
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
This adds a new IsRightToLeft document property, reads/writes it, and
sets dir="rtl" on the top level MathML <math> element if set to true.
Rendering will be handled in next commits.
Change-Id: Ia3078b8a269fef7c3f037a2f1b7799744df2680b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155737
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Move the code outside the else block as it doesn’t get hit for me on
desktop otherwise, and use SmViewShell::IsInlineEditEnabled() instead of
comphelper::LibreOfficeKit::isActive() (which is included in the former).
Followup to:
commit 737a270c61
Date: Mon Jan 17 17:15:46 2022 +0300
lok: enable in-place editing of math equations
Change-Id: Ie604f152344b83479eaf6024b6d58e374abb39b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156331
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
It has been experimental for as long as LibreOffice existed, lets make
it non-experimental but add an option to disable it. If it turns to be a
disaster, we can flip the option and disable it by default.
Change-Id: I63672c054d1ead269863079e7f9c118a44b3ba19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156486
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
The order of reading the settings is significant, e.g. if font italic
was read first then font name, font name would set a new font
overriding the italic setting.
We now collect all font settings and apply them at once.
Change-Id: Idb32d7d416607011bc325eff0b73c03b2d12e7d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156352
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
The math font (default is OpenSymbol) can now be changed from the fonts
dialog like other fonts (variables, numbers, etc).
Change-Id: I57f416173abf7bef8bb66b5e5e393dd928e30652
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156053
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
FC_FONT_WRAPPER requires unreleased FontConfig, but lets have this in so
it works when FontConfig have it.
Change-Id: I8f48ac1f68a3af6e1853e9eb1925d382b57136c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156049
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Adobe Acrobat seems to have a bug with Type 3 fonts with unusual UPEM,
the common 1000 and 2048 UPEM work fine, but Sitka has 2250 UPEM and
Acrobat handles the advance widths in this case incorrectly and
everything gets cramped up with gaps when we re-start glyph positioning.
Workaround this by always using 0.001 scale in FontMatrix (equivalent to
1000 UPEM) and scale everything if the font’s UPEM is different.
Change-Id: I80d25a16456f04bb00304b22b967688fa8260a83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155935
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
These are bit flags, so we were always writing #0000, so now it does
bitwise check for the flags and while at it write the names of the flags
not the numeric values.
Change-Id: I13cae38c0e549b2da1f834a264e3a3255bfa5c5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155793
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Move the alpha inversion down to createBitmapEmit() so that it gets
applied to any bitmap embedded in the PDF, especially since embedded
color bitmap glyphs don't go through the higher level code path.
Regression from:
commit 81994cb2b8
Date: Fri Apr 16 20:33:10 2021 +0200
Convert internal vcl bitmap formats transparency->alpha (II)
Change-Id: I68601a7a0d9ac01f5e8054f074f8e18fcbdea1be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155930
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
If symbol name does not match localized names, try to find a match using
English (export) names.
Change-Id: Id668ee68b07c8431c2780b78e26e07d3aef043aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155553
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Make sure to disable RTL on the OutputDevice, otherwise the math will be
rendered right-to-left without even mirroring the parenthesis.
Change-Id: Iea43dbc0d7efe914120d5cc1605522254344b4fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155538
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
The code was all over the place with classes split between files or
grouped in some files and I couldn’t make a head or tail of it. Move
each class to a dedicated source/header file.
Change-Id: I35daa05b4684c13339c637819dc30fa47a60cf65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155503
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
CN..."
This reverts commit 22c7ce6c8e.
Not needed any more as we now get the style from FontConfig, since:
commit 0b5e88bc88
Author: Khaled Hosny <khaled@libreoffice.org>
Date: Thu Aug 3 13:44:43 2023 +0000
tdf#114192: Speed up populating font list when FontConfig is used
Change-Id: If6a51ffe681896a7ffda1a06da02585e8141c81e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155458
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
(Writer)"
This reverts commit 87d5c863109f7991e3f2f3a1eb970c00d5a27bd5.
Making Writer print selection only by default is not something people
expect, and it is not the default in any other application. Judging by
the number of duplicates, it seems to have caught a lot of people by
surprise, which is not a good UX.
Change-Id: Ia7c8928c474d3390d7f7fee6e0c2e504a41d51b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155422
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Instead of calling psp::PrintFontManager::analyzeFontFile() get the font
names and metadata, use the values taken from FontConfig which nowadays
provides everything we need. This speeds up startup time significantly,
especially when there is a large number of fonts installed.
This also uses the correct style name, we were mixing name id 1 (family)
with name id 17 (typographic subfamily) while we should have been using
name id 2 (subfamily). The name ids 1, 2 and 16, 17 should be used
together not mixed and matched, and we need the former because it is
compatible with the R/I/B/BI model we (and the other office suite) use.
So instead of "Foo Black, Black", we now get "Foo Black, Regular".
On a system with 6616 fonts installed. Before:
$ export OOO_EXIT_POST_STARTUP=1
$ time ./instdir/program/soffice.bin --headless
real 0m4.744s
user 0m1.672s
sys 0m2.547s
after:
$ export OOO_EXIT_POST_STARTUP=1
$ time ./instdir/program/soffice.bin --headless
real 0m1.377s
user 0m0.563s
sys 0m0.297s
Change-Id: Ib7e358f16530c2daabc7ef677ef6a148fdf08e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155313
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
I want to use FC_SYMBOL and this the first stable version to have it,
and our baseline has 2.13.x already.
Change-Id: I606b99190020085cdf20a52788a021543c365fca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155312
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
We only need a family name not a set of name, and drop a work around for
a broken font that is probably long obsolete.
Change-Id: I219ec58e65826250d08b3e88462fdcc1e2e2b7f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155195
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
We want FontAttributes at the end, so lets have them up front instead of
the intermediary structures.
Change-Id: Iafdf17f4a7615f0c3d972e6080cebea0183840b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155191
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
When a Mongolian character is preceded by a Narrow No Break Space
(NNBSP), it is used to trigger special letter forms, but when we do font
fallback NNBSP is always taken from the main font (HarfBuzz synthesises
it when missing from the font, so we almost never use font fallback for
it).
We now check if the start of the fallback run is a Mongolian character
and the previous is NNBSP and extend the fallback run to include it.
Change-Id: I7607dba37ee51ff62bc9e86c3dbc555cd77e8d5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155060
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Narrow No Break Space has special uses in Mongolian, so we want to make
sure it is in the same portion as the Mongolian text, even when it comes
after text from another script group.
We limit this to Mongolian to minimize potential side effects.
Change-Id: Idb4c64cec8581e56acfe9bbb8adf4ddc213aaf19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155000
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
We were setting only Western font when getting the shape, so if there is
no Western characters in the text the default font would be used. There
is no separate setting for CJK/CTL fonts, so we sets the same font for
all the three.
Change-Id: If2ba2a206f95e0efe9139b9d092b1d6dbf05967c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154894
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Unicode names are recognizable more prevalent, no need to invent our own
names.
* Non-breaking Space → No-break Space (aligns also with Narrow No-break Space)
* No-width Optional Break → Zero Width Space
* Remove redundant “Insert”
Change-Id: I005c3fefd24045eb4b5c2054d82638b3f2d5f59f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154886
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Regression from:
commit 7415ce2b97
Author: Khaled Hosny <khaled@aliftype.com>
Date: Mon Dec 5 20:52:13 2022 +0200
tdf#113048: Fix PDF ascender and descender of some fonts
We were setting the font in PDF /Font dictionary, but not inside the
font itself.
Change-Id: I1936f615f62fd7afa8f31d66d35dbded879328c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154880
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>