Skip to content

Custom fonts are not used as no parameter for fontFamilyFallback #89

Open
@dtruong27

Description

@dtruong27

Is your feature request related to a problem? Please describe.
Although in the description of fontFamily in the CodeEditorStyle, fontFamilyFallback is mentioned, it is not a parameter of the class. Therefore, there is no way to pass the custom fonts that are defined in the pubspec.yaml.

    - family: NotoSans
      fonts:
        - asset: assets/fonts/NotoSans-Light.ttf
          weight: 300
        - asset: assets/fonts/NotoSans-Regular.ttf
          weight: 400

Describe the solution you'd like
In the baseStyle

final TextStyle baseStyle = TextStyle(
      fontSize: widget.style?.fontSize ?? _kDefaultTextSize,
      fontFamily: widget.style?.fontFamily,
      height: widget.style?.fontHeight ?? _kDefaultFontHeight,
    );

the fontFamilyFallback should be inherited from the ThemeData of the MaterialApp.

Describe alternatives you've considered
Alternatively, fontFamilyFallback can also be defined as a parameter of the CodeEditorStyle.

Additional context
By default, the system fonts are used as fallback. However, this does not work for flutter web when we have a content security policy that prevents loading external resources.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions