feat (Editor): Add an option to set the editor font family (#1078)
* feat (Editor): Add an option to set the editor font family Add the `editorFontFamily` property to the settings storage and implement font family selection functionality on editor-related pages. Also, update all pages that use the editor settings to support the newly added font family option. * refactor(editor): Optimize the logic for editor font settings Standardize the method for retrieving font settings on the editor page to avoid redundant calls to the `fetch()` method. Extract the font retrieval logic into variables or anonymous functions to improve code readability and performance.
This commit is contained in:
@@ -69,10 +69,12 @@ extension _SSH on _AppSettingsPageState {
|
||||
// iOS can't copy file to app dir, so we need to use the original path
|
||||
if (isIOS) {
|
||||
_setting.fontPath.put(path);
|
||||
await FontUtils.loadFrom(path);
|
||||
} else {
|
||||
final fontFile = File(path);
|
||||
await fontFile.copy(Paths.font);
|
||||
_setting.fontPath.put(Paths.font);
|
||||
await FontUtils.loadFrom(Paths.font);
|
||||
}
|
||||
|
||||
context.pop();
|
||||
|
||||
Reference in New Issue
Block a user