Skip to content

Support per-font OpenType features and shaped character widths - #8843

Open
yay wants to merge 2 commits into
emilk:mainfrom
yay:font-opentype-features
Open

yay wants to merge 2 commits into
emilk:mainfrom
yay:font-opentype-features

Conversation

@yay

@yay yay commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

We use egui in a financial app and want to use our chosen font with tabular (monospaced) digits, so prices and other numbers stay aligned as they change. The font supports this through OpenType's tnum feature, but we need a way to enable it in egui.

This adds per-font OpenType features to FontTweak and makes glyph_width account for them, keeping width measurements consistent with rendered text. For example: features: vec![(*b"tnum", 1)].

API change: FontTweak needs the new features field (or ..Default::default()).

  • I have followed the instructions in the PR template

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Preview available at https://egui-pr-preview.github.io/pr/8843-font-opentype-features
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

@yay
yay marked this pull request as ready for review November 6, 2026 04:52

This branch has not been deployed

No deployments
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