From 23c55696313279f94de0bda5dd9de5ecc0e4c16e Mon Sep 17 00:00:00 2001 From: qishibo Date: Thu, 13 Jun 2019 10:11:11 +0800 Subject: [PATCH] add font tips --- pack/electron/font-manager.js | 2 +- src/components/Setting.vue | 10 ++++++++++ src/i18n/langs/cn.js | 3 +++ src/i18n/langs/en.js | 4 ++++ src/util.js | 4 ++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/pack/electron/font-manager.js b/pack/electron/font-manager.js index 9b738d6..76cee94 100644 --- a/pack/electron/font-manager.js +++ b/pack/electron/font-manager.js @@ -10,6 +10,6 @@ ipcMain.on('get-all-fonts', (event, arg) => { } catch (e) { console.log('main.js get fonts failed...', e); - event.sender.send('send-all-fonts', {family: "Default Initial"}); + event.sender.send('send-all-fonts', [{family: "Default Initial"}]); } }); diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 437b45a..c682139 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -11,6 +11,16 @@ {{ $t('message.font_family') }} + + +

+ font-family +
diff --git a/src/i18n/langs/cn.js b/src/i18n/langs/cn.js index 5ddf178..ec910fb 100644 --- a/src/i18n/langs/cn.js +++ b/src/i18n/langs/cn.js @@ -76,6 +76,9 @@ const cn = { update_downloaded: '更新下载完成,重启客户端生效', mac_not_support_auto_update: 'Mac暂时不支持自动更新,请手动下载后重新安装', font_family: '字体选择', + font_faq_title: '字体设置说明', + font_faq: "1. 可以设置多个字体
2. 字体选择是有序的,建议首先选择英文字体,然后再选择中文字体
\ + 3. 某些异常情况无法加载系统字体列表时,可以手动输入已安装字体名称", }, }; diff --git a/src/i18n/langs/en.js b/src/i18n/langs/en.js index 737207e..46f554f 100644 --- a/src/i18n/langs/en.js +++ b/src/i18n/langs/en.js @@ -76,6 +76,10 @@ const en = { update_downloaded: 'Update Download Completed, Restart Your App Please', mac_not_support_auto_update: 'Mac Does Not Support Automatic Update, Please Manually Download And Reinstall', font_family: 'Font Family', + font_faq_title: 'Font Setting Instructions', + font_faq: "1. Multiple fonts can be set
\ + 2. Font selection is orderly. It is suggested to choose English font first and then font in your language
\ + 3. When the system font list cannot be loaded in some exceptional cases, you can enter the installed font name manually.", }, }; diff --git a/src/util.js b/src/util.js index 0a5cca0..78a1f7c 100644 --- a/src/util.js +++ b/src/util.js @@ -25,4 +25,8 @@ export default { return string.substr(0, maxLength) + '...'; }, + openHrefExternal(e, href) { + e.preventDefault(); + require('electron').shell.openExternal(href); + }, };