From 2ff37df87b226c1198b9700cf7a9906e1c016c45 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 17 Feb 2020 11:57:44 +0300 Subject: [PATCH] Set font hinting as Windows by default --- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/documenteditor/mobile/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/mobile/app/controller/Main.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index e8359ba3c..1e58a8eee 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -166,7 +166,7 @@ define([ var value = Common.localStorage.getItem("de-settings-fontrender"); if (value === null) - window.devicePixelRatio > 1 ? value = '1' : '0'; + value = '0'; Common.Utils.InternalSettings.set("de-settings-fontrender", value); // Initialize api diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index e4094d932..b9b4ec5f2 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -444,7 +444,7 @@ define([ value = Common.Utils.InternalSettings.get("de-settings-fontrender"); item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); - this.cmbFontRender.setValue(item ? item.get('value') : (window.devicePixelRatio > 1 ? 1 : 0)); + this.cmbFontRender.setValue(item ? item.get('value') : 0); value = Common.Utils.InternalSettings.get("de-settings-unit"); item = this.cmbUnit.store.findWhere({value: value}); diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 17416b087..4d270296c 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -94,7 +94,7 @@ define([ var value = Common.localStorage.getItem("de-settings-fontrender"); if (value === null) { - window.devicePixelRatio > 1 ? value = '1' : '0'; + value = window.devicePixelRatio > 1 ? '1' : '0'; } // Initialize api diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 8cad43476..dc5491798 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -153,7 +153,7 @@ define([ } var value = Common.localStorage.getItem("pe-settings-fontrender"); - if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3'; + if (value===null) value = '3'; Common.Utils.InternalSettings.set("pe-settings-fontrender", value); // Initialize api diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 6bedd8268..47a92b521 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -379,7 +379,7 @@ define([ value = Common.Utils.InternalSettings.get("pe-settings-fontrender"); item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); - this.cmbFontRender.setValue(item ? item.get('value') : (window.devicePixelRatio > 1 ? Asc.c_oAscFontRenderingModeType.noHinting : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling)); + this.cmbFontRender.setValue(item ? item.get('value') : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling); value = Common.Utils.InternalSettings.get("pe-settings-unit"); item = this.cmbUnit.store.findWhere({value: value}); diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index a00428664..e6844cd21 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -134,6 +134,10 @@ define([ uiApp.params.notificationCloseButtonText = me.textClose; if (me.api){ + var value = Common.localStorage.getItem("pe-settings-fontrender"); + if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3'; + me.api.SetFontRenderingMode(parseInt(value)); + Common.Utils.Metric.setCurrentMetric(1); //pt me.api.SetDrawingFreeze(true); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 7f8078150..32bccd3bd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -155,7 +155,7 @@ define([ } var value = Common.localStorage.getItem("sse-settings-fontrender"); - if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3'; + if (value===null) value = '3'; Common.Utils.InternalSettings.set("sse-settings-fontrender", value); // Initialize api diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 874ce11e2..79226e90b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -893,7 +893,7 @@ define([ value = Common.Utils.InternalSettings.get("sse-settings-fontrender"); item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); - this.cmbFontRender.setValue(item ? item.get('value') : (window.devicePixelRatio > 1 ? Asc.c_oAscFontRenderingModeType.noHinting : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling)); + this.cmbFontRender.setValue(item ? item.get('value') : Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling); value = Common.Utils.InternalSettings.get("sse-settings-unit"); item = this.cmbUnit.store.findWhere({value: value});