Repository: flutter
Issue: Difficulties when implementing custom text layout for vertical Mongolian script
Labels: c: new feature,framework,engine,a: internationalization,a: typography,c: proposal,P2,team-engine,triaged-engine

Since issue #35994 was closed without being solved, this issue an attempt to follow the [advice](https://github.com/flutter/flutter/issues/35994#issuecomment-571277992) from @Hixie to open a specific use case example and describe the bugs that prevent it from being implemented.

## What I am trying to do

Take Mongolian text that would be rendered as follows in a normal Text widget:

![mongolian_layout_1](https://user-images.githubusercontent.com/10300220/61083299-00f4cd80-a3f1-11e9-9dcc-e2e647201644.png)

And render it vertically with left to right line wrapping. Note that the circled characters in the above image should maintain the same orientation.

<img width="212" alt="mongolian_layout_2" src="https://user-images.githubusercontent.com/10300220/61083462-72cd1700-a3f1-11e9-91e3-9a90a734e373.png">

## Why the current tools don't work

- Doing a simple rotation of a Text widget doesn't work because the lines should wrap from left to right.
- `LineMetrics`, which I reviewed [here](https://medium.com/swlh/flutter-line-metrics-fd98ab180a64), doesn't provide an easy way to access the text of a line. But even if it did, creating a new Paragraph for each line and drawing it in the correct location and orientation isn't enough because emoji and CJK characters within the line need to be rotated differently than the Latin and Mongolian text in that line.
- To know how much text will fit in a line, each word and emoji/CJK character has to be measured. There is no current tool to know where the word and character breaks occur within the string. A naive approach is to break at the spaces, but there are many other places that breaks could and should appear.
- It is not possible to measure or draw a substring within a Paragraph. The only way I know how to do it is to create a new Paragraph object for every single text run (ie, word/emoji/CJK character). This can easily lead to hundreds or even thousands of Paragraphs. I haven't done testing on performance myself yet, but [performance issues have been reported with this](https://github.com/flutter/flutter/issues/35994#issuecomment-513977291).
- This is not a bug per se, but calling a single word a `Paragraph` makes it look like the class could have a better name. It also makes the use of Paragraphs to measure and draw text feel like a hack rather than a good programming practice.

## Final thoughts

In this issue I am not suggesting specific ways I think this should be fixed in order to avoid [proposing a complex solution when a simpler one would do](https://github.com/flutter/flutter/issues/35994#issuecomment-571431454). 

I'm also a little concerned that having such a specific use case will make it difficult for other people to get behind. I think when the issue is generalized a little more, there are a lot of other text rendering use cases that could be solved. But anyway, I'll start here.

Even though I've been dissatisfied with Flutter's text rendering capabilities, I do appreciate all the work the Flutter team has put into the platform as a whole and also how they are willing to listen to our requests.