- opt: android default dir move to external storage
- fix: err when font not exist
This commit is contained in:
lollipopkit
2023-03-27 13:56:17 +08:00
parent 9e3afe98a9
commit 2747df64dd
4 changed files with 22 additions and 11 deletions

View File

@@ -107,7 +107,8 @@ String tabTitleName(BuildContext context, int i) {
Future<void> loadFontFile(String? localPath) async {
if (localPath == null) return;
final name = getFileName(localPath)!;
final name = getFileName(localPath);
if (name == null) return;
var fontLoader = FontLoader(name);
fontLoader.addFont(File(localPath).readAsBytes().byteData);
await fontLoader.load();