Skip to content

[QUESTION] How do I set font family with Google Fonts? #1474

Open
@rivetingpeppermint

Description

@rivetingpeppermint

I want to set font family for my HTML widget using Google Fonts. Here's what I've tried:

TagWrapExtension(
  tagsToWrap: {'body'},
  builder: (child) {
    return DefaultTextStyle(
      style:
          GoogleFonts.robotoFlex(letterSpacing: 0),
      child: child,
    );
  }),

That approach caused my HTML to display without any wrapping (the whole horizontal width of the content is displayed), like so:
Image

While the desired result is something like this:
Image

Is there another approach I can use to use Google Fonts with the HTML widget? Any ideas would be very appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions