Skip to content

Smart Word Wrapping Around Images ("SURROUND") #1200

@YallammaSB

Description

@YallammaSB

version

0.2.0

Link to minimal reproduction

No response

Steps to reproduce

Detect word boundaries during layout (e.g., with element.text.split(/\b/)).

For each word:

Measure word width using canvas context.

If currentLineWidth + wordWidth <= image.leftX, render word before image.

Else, move word to next line or after image (depending on alignment flow).

Respect image margins or paddings (optional).

What is expected?

Detect word boundaries during layout (e.g., with element.text.split(/\b/)).

For each word:

Measure word width using canvas context.

If currentLineWidth + wordWidth <= image.leftX, render word before image.

Else, move word to next line or after image (depending on alignment flow).

Respect image margins or paddings (optional).

What is actually happening?

word is breaking

Editor Value

System Info

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions