[PE] Add option for font rendering
This commit is contained in:
parent
20ccd6280d
commit
cac333ec55
|
@ -307,6 +307,10 @@ define([
|
||||||
}
|
}
|
||||||
/** coauthoring end **/
|
/** 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) {
|
if (this.mode.isEdit) {
|
||||||
value = parseInt(Common.localStorage.getItem("pe-settings-autosave"));
|
value = parseInt(Common.localStorage.getItem("pe-settings-autosave"));
|
||||||
Common.Utils.InternalSettings.set("pe-settings-autosave", value);
|
Common.Utils.InternalSettings.set("pe-settings-autosave", value);
|
||||||
|
|
|
@ -121,6 +121,10 @@ define([
|
||||||
return;
|
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
|
// Initialize api
|
||||||
|
|
||||||
window["flat_desine"] = true;
|
window["flat_desine"] = true;
|
||||||
|
@ -161,6 +165,7 @@ define([
|
||||||
if (this.api){
|
if (this.api){
|
||||||
this.api.SetDrawingFreeze(true);
|
this.api.SetDrawingFreeze(true);
|
||||||
this.api.SetThemesPath("../../../../sdkjs/slide/themes/");
|
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_onError', _.bind(this.onError, this));
|
||||||
this.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(this.onDocumentContentReady, this));
|
this.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(this.onDocumentContentReady, this));
|
||||||
|
|
|
@ -200,6 +200,10 @@ define([
|
||||||
'<td class="left"><label><%= scope.strZoom %></label></td>',
|
'<td class="left"><label><%= scope.strZoom %></label></td>',
|
||||||
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>',
|
'<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>',
|
||||||
'</tr>','<tr class="divider"></tr>',
|
'</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">',
|
'<tr class="edit">',
|
||||||
'<td class="left"><label><%= scope.strUnit %></label></td>',
|
'<td class="left"><label><%= scope.strUnit %></label></td>',
|
||||||
'<td class="right"><span id="fms-cmb-unit" /></td>',
|
'<td class="right"><span id="fms-cmb-unit" /></td>',
|
||||||
|
@ -293,6 +297,18 @@ define([
|
||||||
labelText: this.strAlignGuides
|
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({
|
this.cmbUnit = new Common.UI.ComboBox({
|
||||||
el : $('#fms-cmb-unit'),
|
el : $('#fms-cmb-unit'),
|
||||||
style : 'width: 160px;',
|
style : 'width: 160px;',
|
||||||
|
@ -358,6 +374,10 @@ define([
|
||||||
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
|
this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast);
|
||||||
/** coauthoring end **/
|
/** 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");
|
value = Common.Utils.InternalSettings.get("pe-settings-unit");
|
||||||
item = this.cmbUnit.store.findWhere({value: value});
|
item = this.cmbUnit.store.findWhere({value: value});
|
||||||
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
|
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());
|
Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue());
|
||||||
}
|
}
|
||||||
/** coauthoring end **/
|
/** 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-unit", this.cmbUnit.getValue());
|
||||||
Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
|
Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0);
|
||||||
if (this.mode.canForcesave)
|
if (this.mode.canForcesave)
|
||||||
|
@ -404,6 +425,10 @@ define([
|
||||||
okButtonText: 'Apply',
|
okButtonText: 'Apply',
|
||||||
txtFitSlide: 'Fit to Slide',
|
txtFitSlide: 'Fit to Slide',
|
||||||
txtInput: 'Alternate Input',
|
txtInput: 'Alternate Input',
|
||||||
|
txtWin: 'as Windows',
|
||||||
|
txtMac: 'as OS X',
|
||||||
|
txtNative: 'Native',
|
||||||
|
strFontRender: 'Font Hinting',
|
||||||
strUnit: 'Unit of Measurement',
|
strUnit: 'Unit of Measurement',
|
||||||
txtCm: 'Centimeter',
|
txtCm: 'Centimeter',
|
||||||
txtPt: 'Point',
|
txtPt: 'Point',
|
||||||
|
|
|
@ -1198,6 +1198,10 @@
|
||||||
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
|
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
|
||||||
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
|
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
|
||||||
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
|
"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.cancelButtonText": "Cancel",
|
||||||
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
|
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
|
||||||
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",
|
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",
|
||||||
|
|
|
@ -1193,6 +1193,10 @@
|
||||||
"PE.Views.FileMenuPanels.Settings.txtLast": "Последние",
|
"PE.Views.FileMenuPanels.Settings.txtLast": "Последние",
|
||||||
"PE.Views.FileMenuPanels.Settings.txtPt": "Пункт",
|
"PE.Views.FileMenuPanels.Settings.txtPt": "Пункт",
|
||||||
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Проверка орфографии",
|
"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.cancelButtonText": "Отмена",
|
||||||
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
|
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
|
||||||
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Отображать",
|
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Отображать",
|
||||||
|
|
Loading…
Reference in a new issue