How to add custom fonts to excel generator in flutter. https://pub.dev/packages/excel . We want to create excel file with japanese font "MS Pゴシック" . Is there any chance to add ttf file externally and apply to excel file?
I have added .ttf file in asset folder and applied to the excel file generator . But font did not reflect in the excel file. only inbuilt fonts of that package only applying to excel file, I want to add external fonts "MS Pゴシック" to the file
2
Answers
I found the solution to add custom font in the flutter excel generator by using "syncfusion_flutter_xlsio" sdk.
I have added the sample code for the reference
pubspeck.yaml file
import 'package:syncfusion_flutter_xlsio/xlsio.dart' as xlsio;
generateXLSX() async {
}
Currently, the excel package in Flutter does not natively support embedding custom fonts, such as “MS Pゴシック,” into an Excel file. The package only works with the built-in fonts, and it lacks the functionality for specifying external fonts or embedding .ttf files directly in the generated Excel file.
However, you can consider a few alternative approaches to achieve this, like