INNER CODE UNIT · Dart
FontHelper
gvenusleo/MeRead · lib/helpers/font_helper.dart:9
class FontHelper {
/// Read all font files
static Future<List<String>> readAllFont() async {
List<String> fontNameList = [];
final fontDir = await _getFontDir();
for (var fontFile in fontDir.listSync()) {
final fontName = fontFile.path.split(_getDirSeparator()).last;
_readFont(fontFile.path, fontName);
fontNameList.add(fontName);
}
LogHelper.i('[font]: Read all font files: $fontNameList.');
return fontNameList;
}
/// Read theme font
static Future<void> readThemeFont() async {
final String themeFontName = PrefsHelper.themeFont;
if (themeFontName != 'system') {