Skip to content

feature: add richtext support#551

Open
avdoseferovic wants to merge 1 commit intojohnfercher:masterfrom
avdoseferovic:feat/add-richtext-support
Open

feature: add richtext support#551
avdoseferovic wants to merge 1 commit intojohnfercher:masterfrom
avdoseferovic:feat/add-richtext-support

Conversation

@avdoseferovic
Copy link
Copy Markdown

@avdoseferovic avdoseferovic commented Feb 20, 2026

Description
Before this PR, maroto's text component applies a single style to the entire string , if you
need one bold word in a sentence, you'd have to split it across multiple columns and manually
align them. This is fragile and doesn't support word wrapping across style boundaries.

Tricky Technical Details:

Word wrapping across chunk boundaries
Each chunk can have a different font/size, so a word's pixel width depends on which chunk it
belongs to. The layout algorithm splits all chunks into individual words (preserving their style
association), then measures each word with its own font to decide line breaks. This means a
wrap can happen mid-chunk.

Related Issue
#189

Checklist

check with "x", ONLY IF APPLIED to your change

  • All methods associated with structs has func (<first letter of struct> *struct) method() {} name style.
  • Wrote unit tests for new/changed features.
  • Followed the unit test when,should naming pattern.
  • All mocks created with m := mocks.NewConstructor(t).
  • All mocks using m.EXPECT().MethodName() method to mock methods.
  • Updated docs/doc.go and docs/*
  • Updated example_test.go.
  • Updated README.md
  • New public methods/structs/interfaces has comments upside them explaining they responsibilities
  • Executed make dod with none issues pointed out by golangci-lint

@avdoseferovic
Copy link
Copy Markdown
Author

@johnfercher how do you feel about this one?

@joeyave
Copy link
Copy Markdown

joeyave commented Apr 15, 2026

up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants