Set custom font family (add api parameter customization.font.family)

This commit is contained in:
Julia Radzhabova 2022-11-09 14:45:46 +03:00
parent dcfd578f73
commit f499e31c05
3 changed files with 11 additions and 1 deletions

View file

@ -193,6 +193,9 @@
change: false/true // hide/show feature in de/pe/sse change: false/true // hide/show feature in de/pe/sse
} / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter } / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter
}, },
font: {
font-family: Arial,
},
chat: true, chat: true,
comments: true, comments: true,
zoom: 100, zoom: 100,

View file

@ -61,6 +61,7 @@
@font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; @font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace;
@font-family-tahoma: tahoma, arial, verdana, sans-serif; @font-family-tahoma: tahoma, arial, verdana, sans-serif;
@font-family-base: @font-family-sans-serif; @font-family-base: @font-family-sans-serif;
@font-family-base: var(--font-family-base-custom, @font-family-sans-serif);
@font-size-base: 11px; @font-size-base: 11px;
@font-size-large: 13px; @font-size-large: 13px;

View file

@ -380,6 +380,11 @@ define([
Common.Utils.InternalSettings.set("guest-username", value); Common.Utils.InternalSettings.set("guest-username", value);
Common.Utils.InternalSettings.set("save-guest-username", !!value); Common.Utils.InternalSettings.set("save-guest-username", !!value);
} }
if (this.appOptions.customization.font) {
this.appOptions.customization.font.family && document.documentElement.style.setProperty("--font-family-base-custom", this.appOptions.customization.font.family);
}
this.editorConfig.user = this.editorConfig.user =
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, value ? (value + ' (' + this.appOptions.guestName + ')' ) : this.textAnonymous, this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, value ? (value + ' (' + this.appOptions.guestName + ')' ) : this.textAnonymous,
Common.localStorage.getItem("guest-id") || ('uid-' + Date.now())); Common.localStorage.getItem("guest-id") || ('uid-' + Date.now()));
@ -1418,7 +1423,8 @@ define([
}); });
} }
} else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt && } else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt &&
this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo)) { this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo ||
this.editorConfig.customization.font.family)) {
Common.UI.warning({ Common.UI.warning({
title: this.textPaidFeature, title: this.textPaidFeature,
msg : this.textCustomLoader, msg : this.textCustomLoader,