Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for right-to-left scripts #19

Open
oatmealm opened this issue Jul 23, 2020 · 7 comments
Open

Support for right-to-left scripts #19

oatmealm opened this issue Jul 23, 2020 · 7 comments

Comments

@oatmealm
Copy link

Hi. Thanks for creating this app!

I was wondering if it'd be possible to allow the text area to reflow the text respecting the script it's written in. Native iOS text areas do this automatically, I think.

I'll open another issue about serif fonts...

@oatmealm oatmealm changed the title right-to-left scripts Support for righ-to-left scripts Jul 23, 2020
@amake
Copy link
Owner

amake commented Jul 23, 2020

Orgro is using standard Flutter text widgets, which do support RTL scripts, but I wouldn't be surprised to find that I'm doing something that breaks something.

Can you please provide

  1. A sample org doc using RTL scripts
  2. Screenshots illustrating how it's broken in Orgro
  3. If it's something that Emacs gets right, then screenshots of the correct rendering in Emacs

@oatmealm
Copy link
Author

Hi. Thanks for the reply.

Yes. Emacs has excellent support for RTL. buffers can be tweaked for reflow using 'bidi-paragraph-direction'.

I'll get back to you with screenshots and examples ASAP.

@amake amake changed the title Support for righ-to-left scripts Support for right-to-left scripts Jul 24, 2020
@amake
Copy link
Owner

amake commented Aug 13, 2020

So were there any problems with RTL scripts in Orgro?

@oatmealm
Copy link
Author

Hi there. Sorry for the delay. The only problem that is really effecting usability right now is the alignment. The flow is correct, but text should be of course aligned to the right end side. See examples.

2020-08-13 12-07-48-1

gnome-shell-screenshot-DKB6O0

@amake
Copy link
Owner

amake commented Aug 14, 2020

OK thanks. I may be able to do something about that.

Are you able to provide a sample document?

(Note to self: Probably make use of Bidi in intl package)

amake added a commit that referenced this issue Oct 28, 2022
```
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Layer OffsetEngineLayer was previously used as oldLayer.
Once a layer is used as oldLayer, it may not be used again. Instead, after calling one of the
SceneBuilder.push* methods and passing an oldLayer to it, use the layer returned by the method as
oldLayer in subsequent frames.
'dart:ui/compositing.dart':
Failed assertion: line 110 pos 9: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      _EngineLayerWrapper._debugCheckNotUsedAsOldLayer (dart:ui/compositing.dart:110:9)
#3      SceneBuilder.addRetained.<anonymous closure>.recursivelyCheckChildrenUsedOnce (dart:ui/compositing.dart:695:21)
#4      List.forEach (dart:core-patch/growable_array.dart:416:8)
#5      SceneBuilder.addRetained.<anonymous closure>.recursivelyCheckChildrenUsedOnce (dart:ui/compositing.dart:701:18)
#6      SceneBuilder.addRetained.<anonymous closure> (dart:ui/compositing.dart:704:7)
#7      SceneBuilder.addRetained (dart:ui/compositing.dart:707:6)
#8      Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:671:15)
#9      ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#10     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#11     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#12     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#13     ClipRectLayer.addToScene (package:flutter/src/rendering/layer.dart:1590:5)
#14     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#15     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#16     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#17     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#18     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#19     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#20     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#21     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#22     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#23     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#24     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#25     TransformLayer.addToScene (package:flutter/src/rendering/layer.dart:1914:5)
#26     ContainerLayer.buildScene (package:flutter/src/rendering/layer.dart:1097:5)
#27     RenderView.compositeFrame (package:flutter/src/rendering/view.dart:231:37)
#28     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:514:18)
#29     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:869:13)
#30     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:375:5)
#31     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1271:15)
#32     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1200:9)
#33     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1058:5)
#34     _invoke (dart:ui/hooks.dart:145:13)
#35     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#36     _drawFrame (dart:ui/hooks.dart:112:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════
```
@amake
Copy link
Owner

amake commented Sep 30, 2023

I'm unable to make progress on this without a sample document, and probably some additional feedback on any fixes I make.

@dotancohen
Copy link

dotancohen commented Jun 23, 2024

The problem that I see in both the screenshots and in my installed Orgro is the directionality of the RTL paragraphs. Orgro would need to support different directionality for each paragraph and each heading - e.g. different directionality for each newline-separated string.

I have an explanation of directionality here:
https://dotancohen.com/howto/rtl_right_to_left.html

Basically, RTL directionality will be most obvious in that the text will be right-justified, and also punctuation will show up on the left side of the text.

To test, you can use this text:

שלום, עולם!

The exclamation point should appear on the left of the two words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants