Skip to content

Comments

Add a feature to enable the Path in the software renderer#10227

Closed
ogoffart wants to merge 1 commit intomasterfrom
olivier/swrenderer
Closed

Add a feature to enable the Path in the software renderer#10227
ogoffart wants to merge 1 commit intomasterfrom
olivier/swrenderer

Conversation

@ogoffart
Copy link
Member

@ogoffart ogoffart commented Dec 8, 2025

The PR #9894 implemented support for Path, made a public feature for it similar to software-renderer-systemfonts

Note that since the feature is enabled by default with winit, the "simulator" mode of the mcu examples also enable it. And it can't be disabled.

But there is still a warning in the compiler when using Path element and EmbedForSoftwareRenderer is used as this generally mean that this is for MCU which still can't render Path

The PR #9894 implemented support for Path, made a public feature for it
similar to `software-renderer-systemfonts`

Note that since the feature is enabled by default with winit, the
"simulator" mode of the mcu examples also enable it. And it can't be
disabled.

But there is still a warning in the compiler when using `Path` element
and `EmbedForSoftwareRenderer` is used as this generally mean that this
is for MCU which still can't render `Path`
@ogoffart ogoffart requested a review from tronical December 8, 2025 08:57

## This feature enables the software renderer to render `Path` elements. Requires the "std" feature.
## Enabled by default when the Winit or LinuxKMS backend is enabled.
software-renderer-path = ["renderer-software", "i-slint-core/software-renderer-path"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other features uses renderer-skia-* or renderer-femtovg-*
So perhaps this should be renderer-software-path but i just made it consistent with software-renderer-systemfonts. (although that one should probably be renamed as well?)

Or maybe there shouldn't be a feature and it should be automatic with "std && software-renderer" but that is currently not possible without adding an extra crate (make i-slint-software-renderer?)

Or perhaps fuse it with systemfonts ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think software-renderer-XYZ to just toggle feature (as opposed to a whole default) is fine. That said, I think this is the best option:

Or maybe there shouldn't be a feature and it should be automatic with "std && software-renderer" but that is currently not possible without adding an extra crate (make i-slint-software-renderer?)

Then we can also deprecate software-renderer-systemfonts.

## This feature enables the software renderer to pick up fonts from the operating system for text rendering.
software-renderer-systemfonts = ["renderer-software", "i-slint-core/software-renderer-systemfonts"]

## This feature enables the software renderer to render `Path` elements. Requires the "std" feature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If std is required, then I suppose it should be in line 61 as well? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't put it there because otherwise it'd be a breaking change to remove it when we support no_std path rendering.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok


## This feature enables the software renderer to render `Path` elements. Requires the "std" feature.
## Enabled by default when the Winit or LinuxKMS backend is enabled.
software-renderer-path = ["renderer-software", "i-slint-core/software-renderer-path"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think software-renderer-XYZ to just toggle feature (as opposed to a whole default) is fine. That said, I think this is the best option:

Or maybe there shouldn't be a feature and it should be automatic with "std && software-renderer" but that is currently not possible without adding an extra crate (make i-slint-software-renderer?)

Then we can also deprecate software-renderer-systemfonts.

@ogoffart
Copy link
Member Author

ogoffart commented Dec 8, 2025

Do I understand correctly that you're suggesting to move the software renderer to its own crate instead of this patch?

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be the best option, indeed. But I have no objections if you prefer to go down this feature route. They're not mutually exclusive :)

@ogoffart ogoffart force-pushed the olivier/swrenderer branch 4 times, most recently from aa9f71d to 1b93743 Compare December 8, 2025 18:52
@ogoffart ogoffart closed this Dec 10, 2025
@ogoffart ogoffart deleted the olivier/swrenderer branch December 10, 2025 11:08
@ogoffart
Copy link
Member Author

Replaced by #10251

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