community icon indicating copy to clipboard operation
community copied to clipboard

Add `TextLayout` core provider, remove / migrate old text provider implementation

Open misl6 opened this issue 1 year ago • 0 comments

RTL, BiDi, justification, line height, letter spacing, emojis, font fallback, ellipses, line breaking, max lines ... Oh, what a mess.

Handling text and layouting it correctly, taking care of the needs of all the different scripts and languages from all around the world is not an easy task. But is something we certainly need to have to grow as a framework, and support all the communities around the world.

Over the years, we stratified a pile of workarounds on top of our Text core provider, docs, and unofficial guides with different levels of success. But, was not straightforward, not well integrated, and our users were expecting these features just out-of-the box.

The TextLayout core provider will offer an abstraction that can be used as a bridge between the TextLayout implementation and the widgets that need to lay out a text.

A TextLayout implementation can decide (and advertise) to not conform to all the methods. This will make it possible for our users to keep using non-fully compliant implementations if the fully compliant one is too huge for their use case, or not available on their target platform.

ATM (will update this issue as things evolve) , we're investigating using Skia/SkParagraph as the default TextLayout implementation.

Related issues to consider:

  • https://github.com/kivy/kivy/issues/1701
  • https://github.com/kivy/kivy/issues/2119
  • https://github.com/kivy/kivy/issues/2669
  • https://github.com/kivy/kivy/issues/3459
  • https://github.com/kivy/kivy/issues/4741
  • https://github.com/kivy/kivy/issues/4902
  • https://github.com/kivy/kivy/issues/5660
  • https://github.com/kivy/kivy/issues/5684
  • https://github.com/kivy/kivy/issues/6385
  • https://github.com/kivy/kivy/issues/6790
  • https://github.com/kivy/kivy/issues/7496
  • https://github.com/kivy/kivy/issues/7565
  • https://github.com/kivy/kivy/issues/7704
  • https://github.com/kivy/kivy/issues/7995
  • https://github.com/kivy/kivy/issues/8182
  • https://github.com/kivy/kivy/issues/8213
  • https://github.com/kivy/kivy/issues/8319
  • https://github.com/kivy/kivy/issues/8395
  • https://github.com/kivy/kivy/issues/8394
  • https://github.com/kivy/kivy/issues/8398
  • https://github.com/kivy/kivy/issues/8444

misl6 avatar Jan 20 '24 15:01 misl6