Skip to content

Add public font type conversion utilities#3346

Open
kiedtl wants to merge 3 commits into
iced-rs:masterfrom
kiedtl:font_conversion_utils
Open

Add public font type conversion utilities#3346
kiedtl wants to merge 3 commits into
iced-rs:masterfrom
kiedtl:font_conversion_utils

Conversation

@kiedtl
Copy link
Copy Markdown
Contributor

@kiedtl kiedtl commented May 30, 2026

Replaces the graphics::text::to_* functions with From implementations that convert from Iced's Font, Family, Style, Weight, and Stretch to cosmic_text's equivalents, and vice versa.

cosmic_text::Weight -> Weight is a TryFrom since there isn't an infallible conversion. I thought of just using () as the error but figured I'd just make it a proper error type.

I had to add cosmic_text as a dep for iced_core for this.

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.

1 participant