Description: When I type a formula using Arabic, the command and the output is displayed as if it is a left-to-right writing system. Steps to Reproduce: 1. Open attached file 2. Check out the formula (d = v × t) Actual Results: Command window: المدة times السرعة = المسافة Output window: المدة × السرعة = المسافة Expected Results: Command window: المسافة = السرعة times المدة Output window: المسافة = السرعة × المدة Reproducible: Always User Profile Reset: No Additional Info: Version: 7.0.0.0.beta1 (x64) Build ID: 94f789cbb33335b4a511c319542c7bdc31ff3b3c CPU threads: 4; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win Locale: fr-CH (fr_FR); UI: en-GB Calc: threaded Note: left-to-right and right-to-left toolbar buttons are both disabled (see picture attachment)
Created attachment 162253 [details] Arabic formula test
Created attachment 162254 [details] RTL problem
Our native StarMath, and MathML in general, provide limited support for Presentation Markup of Arabic mathematical notation. Only the Content Markup needed for standard mathematical notation. ICU libs Unicode bidi is functional for literal strings, but literal formulas as in OP simply need to be entered in line with text in the module in use. Would require dev effort to refactor the sm Formula editor to provide logic needed to handle localized literal formula input and localized Presentation martup of formulas. =-ref-= https://www.w3.org/TR/2006/NOTE-arabic-math-20060131/
(In reply to V Stuart Foote from comment #3) > Our native StarMath, and MathML in general, provide limited support for > Presentation Markup of Arabic mathematical notation. Only the Content Markup > needed for standard mathematical notation. > > ICU libs Unicode bidi is functional for literal strings, but literal > formulas as in OP simply need to be entered in line with text in the module > in use. > > Would require dev effort to refactor the sm Formula editor to provide logic > needed to handle localized literal formula input and localized Presentation > martup of formulas. > > =-ref-= > > https://www.w3.org/TR/2006/NOTE-arabic-math-20060131/ I see that the complex formula are difficult to reimplement, but at least for primary and secondary schools, you mostly need the ability to be able to render the unicode bidirectional characters (specially: LRE, RLE, PDF, RLM, LRM, etc.) in the output window. At this moment, this is ignored in the output window, but supported in the command window (however, it should have the right/left alignment).
Yes, probably a valid enhancement that the Formula pane, and inline OLE provide more than simple bidi response to entered strings--and support minimal Presentation markup needs. But IIUC that is not supported in any fashion by current sm command logic and node generators which were implemented to produce normalized mathematical formula content.
Due to poor direction handling of formula parsers, RTL formulas were specifically suppressed for OpenOffice.org i62413 in 2006. https://opengrok.libreoffice.org/xref/core/starmath/source/edit.cxx?a=true&r=be53f326#87
(In reply to V Stuart Foote from comment #6) > Due to poor direction handling of formula parsers, RTL formulas were > specifically suppressed for OpenOffice.org i62413 in 2006. > > https://opengrok.libreoffice.org/xref/core/starmath/source/edit. > cxx?a=true&r=be53f326#87 2006 is considered antiquity era in 2020 ! However, I strongly disagree with Rüdiger Timm's `Even RTL languages don't use RTL for math` !! That's completely wrong, many countries still uses Arabic letters in math formula. People forgot that Math formula could be written in other languages to teach kids in school basic geometry rules. For example, how can somebody type this 5th grade formula without inducing kids in error: مساحة شبه المنحرف = (القاعدة الكبرى + القاعدة الصغرى) × الارتفاع ÷ 2 ( Trapezoid Area = (smaller side + bigger side) × height ÷ 2 ) Making exercises or lessons for kids in school would be impractical in LibreOffice :( I hope in the future that at least the text direction control characters will be supported in math formula output..
(In reply to libre officer from comment #7) > ... > 2006 is considered antiquity era in 2020 ! > > However, I strongly disagree with Rüdiger Timm's `Even RTL languages don't > use RTL for math` !! That's completely wrong, many countries still uses > Arabic letters in math formula. Actually believe the commit author was Alan Yaniger, working with Thomas Lang. https://bz.apache.org/ooo/attachment.cgi?id=39273&action=diff > > People forgot that Math formula could be written in other languages to teach > kids in school basic geometry rules. For example, how can somebody type this > 5th grade formula without inducing kids in error: > > > مساحة شبه المنحرف = (القاعدة الكبرى + القاعدة الصغرى) × الارتفاع ÷ 2 > > ( Trapezoid Area = (smaller side + bigger side) × height ÷ 2 ) > > > Making exercises or lessons for kids in school would be impractical in > LibreOffice :( > > > I hope in the future that at least the text direction control characters > will be supported in math formula output.. +1, and it could be as simple as enabling RTL for the sm edit shell to allow Command windows input RTL in addition to the Bidi handling--but more likely the sm node creation logic is coded only for standard mathematical formulas. Getting reasonable RTL Presentation syntax may require sm logic specific to handle: U+200E LEFT-TO-RIGHT MARK (LRM) U+200F RIGHT-TO-LEFT-MARK (RLM) U+202A LEFT-TO-RIGHT EMBEDDING (LRE) U+202B RIGHT-TO-LEFT EMBEDDING (RLE) U+202C POP DIRECTIONAL FORMATTING (PDF) U+202D LEFT-TO-RIGHT OVERRIDE (LRO) U+202E RIGHT-TO-LEFT OVERRIDE (RLO) U+2066 LEFT-TO-RIGHT ISOLATE (LRI) U+2067 RIGHT-TO-LEFT ISOLATE (RLI)
The text rendering here on bugzilla may be confusing us regarding the actual and expected results. Can you explain, in words, what order should the parts of the equation appear in? e.g. "From left to write, the words you should see are FOO, then BAR, then BAZ" Also, are you complaining about what's in the output window, the edit window or both?
Created attachment 177313 [details] RTL formula displayed vs. Expected
(In reply to Eyal Rozenberg from comment #9) > The text rendering here on bugzilla may be confusing us regarding the actual > and expected results. Can you explain, in words, what order should the parts > of the equation appear in? e.g. "From left to write, the words you should > see are FOO, then BAR, then BAZ" > > Also, are you complaining about what's in the output window, the edit window > or both? Hello Eyal, Please check the picture that I just uploaded, titled ` RTL formula displayed vs. Expected`. The problem is that the formula in the text mode letters are ordered correctly, from right-to-left. However, in the display window on top of it, you can see that the order of the letters is incorrect : This will be a problem if letters are words in a sentence, because reading it will be confusing. In a short summary: the formula of the top should look exactly like the one in the bottom.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5c5c71266ff14493975f20ff5807f31565a3f909 tdf#134193: Add the ability to set RTL math direction It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fb43c497f2cc71c988a967fa0126c27561f8c16d tdf#134193: Support rendering math in RTL mode It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b6c30b3d35eb01205acf0271d0192921c60eb73b tdf#134193: Allow setting math direction It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fe3098b4c4b5b8099e43279044db9ae7a1e0999d tdf#134193: Fix RTL selection and cursor handling It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Khaled Hosny committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f80c2c70756e3620daed6675c8546caca4153d4b tdf#134193: Fix inline editing with RTL direction It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Khaled! In release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.2&type=revision&diff=715802&oldid=715801 A screenshot and a better description would be welcome!
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/71e905b62b02f28e6eca728f763a845509bf5a1a Related tdf#134193: declare right-to-left in Math.xcs It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.