1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-10 16:10:55 +00:00
* Added: Support for OpenDyslexic and Google Fonts. Font Family settings now provide a list of fonts to choose from, in addition to allowing a custom font to be entered.
* Changed: When saving a settings backup, the current date will be included in the filename by default. (Closes #1084)
This commit is contained in:
SirStendec 2021-09-06 16:48:48 -04:00
parent a529e7fd27
commit 04cfbe6ed9
23 changed files with 394 additions and 28 deletions

View file

@ -8,6 +8,7 @@ import {Color, ColorAdjuster} from 'utilities/color';
import {get, has, make_enum, shallow_object_equals, set_equals, deep_equals} from 'utilities/object';
import {WEBKIT_CSS as WEBKIT} from 'utilities/constants';
import {FFZEvent} from 'utilities/events';
import {useFont} from 'utilities/fonts';
import Module from 'utilities/module';
@ -717,6 +718,14 @@ export default class ChatHook extends Module {
lh = Math.round((20/12) * size);
let font = this.chat.context.get('chat.font-family') || 'inherit';
const [processed, unloader] = useFont(font);
font = processed;
if ( this._font_unloader )
this._font_unloader();
this._font_unloader = unloader;
if ( font.indexOf(' ') !== -1 && font.indexOf(',') === -1 && font.indexOf('"') === -1 && font.indexOf("'") === -1 )
font = `"${font}"`;