Shahxad-Akram / flutter_tex

A Flutter Package to render Mathematics, Physics and Chemistry Equations based on LaTeX
https://pub.dartlang.org/packages/flutter_tex
Other
277 stars 135 forks source link

Font not changing in TeXView widget despite specifying custom font in pubspec.yaml #192

Open neeraj-pencill opened 3 months ago

neeraj-pencill commented 3 months ago

I am encountering an issue where the custom font specified in the pubspec.yaml file is not being applied to the TeXView widget in my Flutter project. Despite following the necessary steps to include the custom font, the TeXView widget continues to use the default font.

dakshvasudev commented 2 months ago

Hi, I encountered the same issue

TeXView(
      renderingEngine: widget.renderingEngine,
      fonts: const [
        TeXViewFont(
          fontFamily: "inter",
          src: "assets/fonts/RobotoMono-Regular.ttf",
        )
      ],
      child: TeXViewDocument(
        styledHtml,
        style: const TeXViewStyle(
          padding: TeXViewPadding.all(8),
        ),
      ),
      loadingWidgetBuilder: (context) => const Center(
        child: AdaptiveLoading(),
      ),
    );

use the font property in the TexView itself

Shahxad-Akram commented 2 months ago

I can't reproduce the problem.

Please see if you've properly added fonts in the pubsepc.yaml.