Skip to content

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Dec 5, 2025

Objective

Add font weight support.

Solution

New FontWeight struct that newtypes a u16.
New font: FontWeight field on TextFont.
The weight attribute for the cosmic text buffer is set in TextPipeline during text updates.

I added stretch and slant as well, but split them off from this PR. Swash only has limited variable-font support and there's no way to demonstrate that they work without other changes.

Testing

Added a basic example:
cargo run --example font_weights

The example uses the Noto Sans font, this should probably be removed before merging as it's quite large.

Showcase

font_weights

@ickshonpe ickshonpe changed the title Font weights Font weight support Dec 5, 2025
@ickshonpe ickshonpe added A-Text Rendering and layout for characters C-Feature A new feature, making something new possible M-Release-Note Work that should be called out in the blog due to impact D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes M-Release-Note Work that should be called out in the blog due to impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant