add mode7 font

+ can now inject custom theme styles
This commit is contained in:
Felix Roos 2023-08-28 23:52:24 +02:00
parent 0e3d84e5ca
commit 289376840e
7 changed files with 24 additions and 2 deletions

View file

@ -377,6 +377,7 @@ const fontFamilyOptions = {
'FiraCode-SemiBold': 'FiraCode SemiBold',
protracker3: 'protracker3',
teletext: 'teletext',
mode7: 'mode7',
};
function SettingsTab({ scheduler }) {

View file

@ -475,3 +475,11 @@ function getCircularReplacer() {
function stringifySafe(json) {
return JSON.stringify(json, getCircularReplacer());
}
export function injectStyle(rule) {
const newStyle = document.createElement('style');
document.head.appendChild(newStyle);
const styleSheet = newStyle.sheet;
const ruleIndex = styleSheet.insertRule(rule, 0);
return () => styleSheet.deleteRule(ruleIndex);
}