Skip to content

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jan 5, 2026

Objective

Add support for generic font families.

Solution

Support for generic font families has been added through new FontSource variants: Serif, SansSerif, Cursive, Fantasy, and Monospace.

The implementation is very simple, mostly just a mapping from the FontSource generic font family variants to the corresponding Cosmic Text Family variants.

Seems to work correctly, but the other text features follow up PRs should be merged first.

Showcase

Screenshot 2026-01-05 214103

…, creating a new font with a new font ID to cosmic text's FontDb from the font asset each text update.

This commit removes the responsibility of loading fonts to cosmic text's database and associating them with an asset id from `TextPipeline`. Instead the font family name is added to the `Font` asset after loading.

Then in `TextPipeline::update_buffer` it just gets the family name from the asset and there's no possibility of a leak.
@ickshonpe ickshonpe added S-Blocked This cannot move forward until something else changes A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Release-Note Work that should be called out in the blog due to impact labels Jan 5, 2026
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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Release-Note Work that should be called out in the blog due to impact S-Blocked This cannot move forward until something else changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant