Cleanup loading terminal fonts (#6937)

* Cleanup loading terminal fonts

- Make list of possible fonts fully OCP
- Only mark the loading of a font as 'causesSideEffects'
- Make a view model for the terminal font preferences component
- Move the TTF files next to where they are registered to help with finding them

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Cleanup formatting and change model to presenter

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2023-01-17 08:11:52 -05:00
1 parent cf27605a21
commit e635d82ea5
25 files changed
+298 -140

No files matched your search

@@ -0,0 +1,18 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { terminalFontInjectionToken } from "./token";
import RobotoMono from "./Roboto-Mono.ttf"; // patched font with icons
const robotoMonoTerminalFontInjectable = getInjectable({
id: "roboto-mono-terminal-font",
instantiate: () => ({
name: "RobotoMono",
url: RobotoMono,
}),
injectionToken: terminalFontInjectionToken,
});
export default robotoMonoTerminalFontInjectable;