add font tips

This commit is contained in:
qishibo 2019-06-13 10:11:11 +08:00
parent fbea3b28c0
commit 23c5569631
5 changed files with 22 additions and 1 deletions

View File

@ -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"}]);
}
});

View File

@ -11,6 +11,16 @@
<el-form-item :label="$t('message.font_family')">
<span slot="label">
{{ $t('message.font_family') }}
<el-popover
placement="top-start"
:title="$t('message.font_faq_title')"
width="200"
trigger="hover"
>
<i slot="reference" class="el-icon-question"></i>
<p v-html="$t('message.font_faq')"></p>
<a href="###" @click="$util.openHrefExternal($event, 'https://developer.mozilla.org/docs/Web/CSS/font-family')">font-family</a>
</el-popover>
<i v-if="loadingFonts" class="el-icon-loading"></i>
</span>
<el-select v-model="form.fontFamily" @visible-change="getAllFonts" allow-create default-first-option filterable multiple >

View File

@ -76,6 +76,9 @@ const cn = {
update_downloaded: '更新下载完成,重启客户端生效',
mac_not_support_auto_update: 'Mac暂时不支持自动更新请手动下载后重新安装',
font_family: '字体选择',
font_faq_title: '字体设置说明',
font_faq: "1. 可以设置多个字体<br>2. 字体选择是有序的建议首先选择英文字体然后再选择中文字体<br>\
3. 某些异常情况无法加载系统字体列表时可以手动输入已安装字体名称",
},
};

View File

@ -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<br>\
2. Font selection is orderly. It is suggested to choose English font first and then font in your language<br>\
3. When the system font list cannot be loaded in some exceptional cases, you can enter the installed font name manually.",
},
};

View File

@ -25,4 +25,8 @@ export default {
return string.substr(0, maxLength) + '...';
},
openHrefExternal(e, href) {
e.preventDefault();
require('electron').shell.openExternal(href);
},
};