Skip to content

Bengali Font not rendering well #123

@RomjanHossain

Description

@RomjanHossain

All the mathematical expression works fine. but when it comes to Bengali text, it brokes badly. i've tried using GoogleFonts, Local Fonts (assets/fonts/*), but None of them works.

options: MathOptions(
                                fontSize: 11,
                                mathFontOptions: FontOptions(
                                  fontFamily: 'NotoSansBengali',
                                ),
                                textFontOptions: FontOptions(
                                  fontWeight: FontWeight.normal,
                                  fontFamily: 'NotoSansBengali',
)),
Math.tex(
              '\\text{জ্যামিতি সম্পর্কিত} \quad \sum_{n=1}^{\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}',
              textStyle: GoogleFonts.notoSansBengali(
                fontSize: 24, // Adjust size as needed
                color: Colors.black,
              ),

              mathStyle: MathStyle.display,
),

Error log:
[Flutter Math] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "জ used in math mode" [unicodeTextInMathMode]

when i try to add custom fonts to mathFontOption, it shows:
Build Exception: Unsanitized build exception detected: Exception: Font metrics not found for font: NotoSansBengali-Regular..Pleasae report this error with corresponding input.

code:

mathFontOptions: FontOptions(
                             fontFamily: 'NotoSansBengali',
),
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions