[FEATURE] add support for specifying font package
Describe your feature request
Currently if our fonts are located inside a local package they cannot be retrieved inside flutter_html Style() like they can in a regular Flutter TextStyle() :
TextStyle(
package: 'ui_package',
fontFamily: 'Circular Air Pro',
color: Colors.green,
);
It would look something like this :
Html(
data: mockData,
style: {
'body': Style(
package: 'ui_package', // specify font package here
fontFamily: 'Circular Air Pro',
margin: EdgeInsets.zero,
padding: EdgeInsets.zero,
),
},
),
Additional request
It would also be nice to be able to use TextStyle( ) rather than Style( )
A picture of a cute animal (not mandatory but encouraged) 🐹
This would be helpful for GoogleFonts as well. At the moment, we can't really set the style (e.g. fontWeight) for a Google font inside the Html widget, can we? Additionally, if I set a Google font as standard font in the TextTheme of the app, some letters look really strange (see screenshot). This is just on Android! On iOS everything looks good. Is there a way to fix this?

Thanks for the feedback @AristideVB! I agree, font package support definitely seems like a valid use case. I'll look into what it will take to get that added. As for using TextStyle instead of Style, have you looked into the Style.fromTextStyle constructor?
@hschk That is certainly strange. I've used Google Fonts myself and haven't seen the issue. Do you have a reproducible example?
I'm also looking for global customization of font family from GoogleFonts for Html widget. Would love to use it.
I'm also looking for global customization of font family from GoogleFonts for
Htmlwidget. Would love to use it.
It's possible to use Google Fonts like this