Skip to content

Introduce API for wrapping text around and within shapes #287

@stackotter

Description

@stackotter

This is an advanced feature that may be difficult to implement under some backends, but a UIKit/AppKit proof of concept shouldn't be too difficult using NSTextContainer.exclusionPaths and whatever the AppKit equivalent is. If possible, it'd be super nice to be able to flow text through the empty space in a view (based on the clip shape of each view.

SwiftUI doesn't have an equivalent API for us to base ours off.

For Gtk we'll likely have to implement a bunch of custom text rendering logic (on top of Pango).

TextFill("Lorem ipsum dolor sit amet ...") {
    HStack {
        Image(...).resizable().frame(width: 100)
        Spacer()
    }

    Spacer().frame(height: 200)

    HStack {
        Spacer()
        Image(...).resizable().frame(width: 100)
    }
}.frame(width: 400)

We likely won't be able to tackle this feature until SwiftCrossUI has a more solid concept of 'clip shape'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions