Custom Fonts

To use custom fonts for TeXView, create a create a file named flutter_tex.css in the root of your project's assets directory, this style file should define your custom fonts. Your project structure should look like this:

1
2
3
4
5
6
your_flutter_app/
├── assets/
│   ├── fonts/
│   └── flutter_tex.css
├── lib/
...

and make sure to add this into pubspec.yaml like:

1
2
3
4
flutter:
  uses-material-design: true
  assets:
    - assets/flutter_tex.css

An example flutter_tex.css file defining a custom font:

1
2
3
4
@font-face {
    font-family: 'army';
    src: url("fonts/Army.ttf");
}
Then you can use this custom font in your TeXViewStyle like this:

1
2
3
4
TeXViewStyle(
  fontStyle: TeXViewFontStyle(
      fontFamily: 'army'),
)