1

SkParagraph automatically compensates for "ghostwhitespace" when shaping a paragraph. I'd like to disable this behaviour and allow the line to pushed out when whitespace is introduced.

Center alignment with current behaviour:

       The quick brown fox 
          ate a zesty
         hamburgerfons .
         The ‍‍‍ laughed.

Now adding loads of spaces after zesty: (desired behaviour)

       The quick brown fox 
   ate a zesty
         hamburgerfons .
         The ‍‍‍ laughed.

Notice second line pushed to the left due to all the extra whitespace.

I've modified this CanvasKit fiddle to illustrate. See line 40.

I've also found this flutter issue that illustrates the issue.

I've gone through the Skia / SkParagraph source code many times over and can't find a way to introduce the behaviour I need.

matanube
  • 407
  • 3
  • 11

0 Answers0