[PE] Add option for font rendering

This commit is contained in:
Julia Radzhabova 2019-02-28 15:01:47 +03:00
parent 20ccd6280d
commit cac333ec55
5 changed files with 42 additions and 0 deletions

View file

@ -307,6 +307,10 @@ define([
}
/** coauthoring end **/
value = Common.localStorage.getItem("pe-settings-fontrender");
Common.Utils.InternalSettings.set("pe-settings-fontrender", value);
this.api.SetFontRenderingMode(parseInt(value));
if (this.mode.isEdit) {
value = parseInt(Common.localStorage.getItem("pe-settings-autosave"));
Common.Utils.InternalSettings.set("pe-settings-autosave", value);

View file

@ -121,6 +121,10 @@ define([
return;
}
var value = Common.localStorage.getItem("pe-settings-fontrender");
if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3';
Common.Utils.InternalSettings.set("pe-settings-fontrender", value);
// Initialize api
window["flat_desine"] = true;
@ -161,6 +165,7 @@ define([
if (this.api){
this.api.SetDrawingFreeze(true);
this.api.SetThemesPath("../../../../sdkjs/slide/themes/");
this.api.SetFontRenderingMode(parseInt(value));
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
this.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(this.onDocumentContentReady, this));

View file

@ -200,6 +200,10 @@ define([
'<td class="left"><label><%= scope.strZoom %></label></td>',
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>',
'</tr>','<tr class="divider"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strFontRender %></label></td>',
'<td class="right"><span id="fms-cmb-font-render" /></td>',
'</tr>','<tr class="divider"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strUnit %></label></td>',
'<td class="right"><span id="fms-cmb-unit" /></td>',
@ -293,6 +297,18 @@ define([
labelText: this.strAlignGuides
});
this.cmbFontRender = new Common.UI.ComboBox({
el : $('#fms-cmb-font-render'),
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: Asc.c_oAscFontRenderingModeType.hintingAndSubpixeling, displayValue: this.txtWin },
{ value: Asc.c_oAscFontRenderingModeType.noHinting, displayValue: this.txtMac },
{ value: Asc.c_oAscFontRenderingModeType.hinting, displayValue: this.txtNative }
]
});
this.cmbUnit = new Common.UI.ComboBox({
el : $('#fms-cmb-unit'),
style : 'width: 160px;',
@ -358,6 +374,10 @@ define([
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
/** coauthoring end **/
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));
value = Common.Utils.InternalSettings.get("pe-settings-unit");
item = this.cmbUnit.store.findWhere({value: value});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
@ -383,6 +403,7 @@ define([
Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue());
}
/** coauthoring end **/
Common.localStorage.setItem("pe-settings-fontrender", this.cmbFontRender.getValue());
Common.localStorage.setItem("pe-settings-unit", this.cmbUnit.getValue());
Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
if (this.mode.canForcesave)
@ -404,6 +425,10 @@ define([
okButtonText: 'Apply',
txtFitSlide: 'Fit to Slide',
txtInput: 'Alternate Input',
txtWin: 'as Windows',
txtMac: 'as OS X',
txtNative: 'Native',
strFontRender: 'Font Hinting',
strUnit: 'Unit of Measurement',
txtCm: 'Centimeter',
txtPt: 'Point',

View file

@ -1198,6 +1198,10 @@
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"PE.Views.FileMenuPanels.Settings.strFontRender": "Font Hinting",
"PE.Views.FileMenuPanels.Settings.txtMac": "as OS X",
"PE.Views.FileMenuPanels.Settings.txtNative": "Native",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Cancel",
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",

View file

@ -1193,6 +1193,10 @@
"PE.Views.FileMenuPanels.Settings.txtLast": "Последние",
"PE.Views.FileMenuPanels.Settings.txtPt": "Пункт",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Проверка орфографии",
"PE.Views.FileMenuPanels.Settings.strFontRender": "Хинтинг шрифтов",
"PE.Views.FileMenuPanels.Settings.txtMac": "как OS X",
"PE.Views.FileMenuPanels.Settings.txtNative": "Собственный",
"DE.Views.FileMenuPanels.Settings.txtWin": "как Windows",
"PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Отмена",
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Отображать",