Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for italic text rendering #2795

Merged
merged 3 commits into from May 31, 2023
Merged

Add support for italic text rendering #2795

merged 3 commits into from May 31, 2023

Conversation

tronical
Copy link
Member

For now this is just a boolean property - that's the API that's easiest to learn and use. If we implement a generic style enum / mask later, then we can map that in the compiler to the corresponding expression.

Closes #2317

@tronical tronical force-pushed the simon/text-italic branch 2 times, most recently from af54cee to 1086b00 Compare May 30, 2023 14:01
@@ -17,6 +17,38 @@ pub struct FontDatabase {
target_arch = "wasm32"
)))]
pub fontconfig_fallback_families: Vec<String>,
// Default font famiilies to use instead of SansSerif when SLINT_DEFAULT_FONT env var is set.
Copy link
Member

Choose a reason for hiding this comment

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

famiilies

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a very emotional family :-)

Copy link
Member

Choose a reason for hiding this comment

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

Do I read the patch correctly that bold is supported now? If yes it'd be nice to be tested 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.

It's not quite there yet. I added the weight because... it was right there in my face :-). But it's not matched for yet. But you're right, might as well do it in one shot. I need to fix the screenshot bit anyway.

…nput`

This is implemented for FemtoVG, Skia, and Qt.
Centralize also fontdb::Query creation and family fallback handling in
sharedfontdb. This way SLINT_DEFAULT_FONT also works for the femtovg
renderer.
…p font path

In the screenshot tests this works by setting SLINT_DEFAULT_FONT to
pointer to a directory, instead of a file. We then load all fonts in
that directory and consider their families the default unless a family
is specified. This way for "Noto Sans" a regular as well as an italic
version is registered in fontdb and returned in the list of font
fallback ids. embed_glyphs in the compiler then embeds those variants
and we find them at run-time.
@tronical tronical merged commit 6b8214c into master May 31, 2023
24 checks passed
@tronical tronical deleted the simon/text-italic branch May 31, 2023 16:47
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.

Add support for selecting italic styles from fonts
2 participants