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

Feature/add font family fallback #1079

Conversation

kaiquegazola
Copy link
Contributor

Add fontFamilyFallback param to Style and pass it to TextStyle.

Usage:

Html(
      data: '<span>‟Pessoas que se recuperaram, »’”›⸃⸅⸊⸍⸝⸡ [...]”</span>',
      style: <String, Style>{
        'span': Style(
          fontFamily: 'Lato',
          fontFamilyFallback: ['Arial', 'Roboto'],
        ),
      },
);

and can render characters that do not exist in the main fontFamily (and exist in any of fallback fontFamily, in order, of course):
image

This pr can close #1078

Copy link
Collaborator

@erickok erickok left a comment

Choose a reason for hiding this comment

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

Looks good to me. thanks for the contribution. What do you think @Sub6Resources ?

@Sub6Resources Sub6Resources self-requested a review June 14, 2022 13:42
Copy link
Owner

@Sub6Resources Sub6Resources left a comment

Choose a reason for hiding this comment

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

LGTM. Fairly straightforward, thank you! My only thought is that in CSS, font-family is one attribute that handles both of these cases. This looks good, and I'll add and take on an issue to create tests to ensure the css parser correctly splits font-family into our fontFamily and fontFamilyFallback attributes.

@Sub6Resources Sub6Resources merged commit c797ef8 into Sub6Resources:master Jun 14, 2022
@kaiquegazola kaiquegazola deleted the feature/add-font-family-fallback branch May 15, 2023 23:43
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.

[FEATURE] Add font fallback
3 participants