-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 91bf182
Showing
11 changed files
with
765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<div align="center"> | ||
<img alt="icon" src="https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/public/icon.png" style="width: 8em; height: 8em;"> | ||
|
||
--- | ||
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?include_prereleases&style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases/latest) | ||
[![GitHub Release Date](https://img.shields.io/github/release-date/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases/latest) | ||
[![GitHub License](https://img.shields.io/github/license/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/blob/main/LICENSE) | ||
[![GitHub last commit](https://img.shields.io/github/last-commit/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/commits/main) | ||
![GitHub repo size](https://img.shields.io/github/repo-size/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square) | ||
![hits](https://hits.b3log.org/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts.svg) | ||
[![GitHub all releases](https://img.shields.io/github/downloads/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/total?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases) | ||
|
||
--- | ||
[简体中文](./README_zh_CN.md) \| English | ||
|
||
--- | ||
</div> | ||
|
||
# SiYuan Custom Fonts | ||
|
||
A plugin for [SiYuan Note](https://github.com/siyuan-note/siyuan) that allows you to customize the list of fonts used by various elements in the interface. | ||
|
||
## PREVIEW | ||
|
||
![preview image](https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/public/preview.png) | ||
|
||
## INTRODUCTION | ||
|
||
### Function Introduction | ||
|
||
* Built-in [Twitter emoji (Twemoji)](https://github.com/mozilla/twemoji-colr) font | ||
|
||
* This font can be referenced by the font family name `Twemoji Mozilla` | ||
* Check the font list in the system where the kernel is located | ||
|
||
* Some fonts in this list cannot be loaded when using a server. | ||
* Check the font list supported by the current application (desktop/browser) | ||
|
||
* The font list that can be used in the current application. | ||
* Custom CSS code snippets | ||
|
||
* Can dynamically load local/network font files through [@font-face](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face). | ||
* Customize the font list of various elements in the interface: | ||
|
||
* `Basic font`: the fonts used in the interface | ||
* `Editor font`: the fonts used in editor | ||
* `Code font`: the fonts used in inline code, code blocks and text input boxes | ||
* `Chart font`: the fonts used in relationship diagrams | ||
* `Math font`: the fonts used in inline formulas and formula blocks | ||
* `Emoji font`: the fonts used in emojis (used for document icons) | ||
|
||
### Setting Introduction | ||
|
||
* `General Settings` | ||
|
||
* `Reset Settings Options` | ||
|
||
* This is a button | ||
* Reset all settings options to their default options | ||
* Clicking this button will prompt a confirmation dialogue | ||
|
||
* Clicking the dialogue confirmation button will reset all options in this plugin to their default options and then automatically refresh the current interface | ||
* `System Font List` | ||
|
||
* This is a button | ||
* View the font list of the system in which the kernel is located | ||
* Clicking this button will prompt a dialogue displaying the system font list | ||
* `Available Font List` | ||
|
||
* This is a button | ||
* View the list of fonts currently supported by the application | ||
* Clicking this button will prompt a dialogue displaying the available font list | ||
|
||
* The font family reference name is displayed on the right-hand side of the top-level list item, which is needed when customizing fonts | ||
* When the top-level list item is expanded, all font styles in that family can be viewed | ||
* `CSS Snippet` | ||
|
||
* `Enabled` | ||
|
||
* This is a toggle | ||
* Default state: *On* | ||
* When the toggle is turned on, the CSS code snippet below this setting will be applied to the current interface | ||
* `CSS Snippet` | ||
|
||
* This is a text input box | ||
* A `@font-face` rule is registered by default, used to load the [Twemoji Mozilla](https://github.com/mozilla/twemoji-colr) emoji font included with the plugin | ||
* For details, please refer to [@font-face - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face) | ||
* `Font Settings` | ||
|
||
* Font lists need to specify the font family name to determine the font being used | ||
|
||
* For example, the font family name for `微软雅黑` is `Microsoft YaHei` | ||
* The font families currently supported by the application can be viewed by going to `General Settings` > `Available Font List` | ||
* One font family name is set per line in the font list, with higher priority fonts listed first | ||
* `Base Font`: Font used for the user interface | ||
|
||
* Customizable font list for text outside of the editor | ||
* `Editor font`: The font used for text in the editor. | ||
|
||
* This tab allows customization of the font list used for text in the editor. | ||
* On the desktop, this font list has lower priority than the `SiYuan Settings`→`Editor`→`Font` setting. | ||
|
||
* To apply this font list on the desktop, set the `SiYuan Settings`→`Editor`→`Font` setting to `Default`. | ||
* `Code font`: The font used for inline code, code blocks, and text input boxes. | ||
|
||
* This tab allows customization of the font used for text in `inline code`, `code blocks`, and `text input boxes` in the editor. | ||
* `Chart Font`: Font used for relationship diagrams | ||
|
||
* Customizable font list for text in relationship diagrams | ||
* `Math Font`: Font used for inline formulas and formula blocks | ||
|
||
* Customizable font list for text in `inline formulas` and `math formula blocks` within the editor | ||
* `Emoji Font`: Font used for emoji symbols (used in document icons) | ||
|
||
* Customizable font list for emoji symbols used in document icons | ||
* `Menu Settings` | ||
|
||
* `Block font list` | ||
|
||
* This is a text input box | ||
* Each line of the text box specifies a font name, and you can use the block menu to set the font of the block to this font | ||
|
||
## CHANGELOG | ||
|
||
[CHANGELOG.md](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/blob/main/CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<div align="center"> | ||
<img alt="图标" src="https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/public/icon.png" style="width: 8em; height: 8em;"> | ||
|
||
--- | ||
[![GitHub 最新发行版本 (最新一次发行/预发行)](https://img.shields.io/github/v/release/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?include_prereleases&style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases/latest) | ||
[![GitHub 最新发行时间](https://img.shields.io/github/release-date/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases/latest) | ||
[![GitHub 许可证](https://img.shields.io/github/license/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/blob/main/LICENSE) | ||
[![GitHub 最后一次提交时间](https://img.shields.io/github/last-commit/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/commits/main) | ||
![GitHub 仓库大小](https://img.shields.io/github/repo-size/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts?style=flat-square) | ||
![查看次数](https://hits.b3log.org/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts.svg) | ||
[![GitHub 发行版本下载次数](https://img.shields.io/github/downloads/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/total?style=flat-square)](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/releases) | ||
|
||
--- | ||
简体中文 \| [English](./README.md) | ||
|
||
--- | ||
</div> | ||
|
||
# 思源自定义字体插件 | ||
|
||
一款可以自定义界面中各类元素所使用的字体列表的[思源笔记](https://github.com/siyuan-note/siyuan)插件。 | ||
|
||
## 预览 | ||
|
||
![预览图片](https://cdn.jsdelivr.net/gh/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/public/preview.png) | ||
|
||
## 介绍 | ||
|
||
### 功能介绍 | ||
|
||
* 内置 [Twitter Emoji (Twemoji)](https://github.com/mozilla/twemoji-colr) 表情符号字体 | ||
|
||
* 可通过字体族名 `Twemoji Mozilla` 引用该字体 | ||
* 查看内核所在系统的字体列表 | ||
|
||
* 在使用伺服时该列表中的部分字体无法加载 | ||
* 查看当前应用(桌面端/浏览器)支持的字体列表 | ||
|
||
* 在当前应用中可以使用的字体列表 | ||
* 自定义 CSS 代码片段 | ||
|
||
* 可通过 [@font-face](https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face) 动态加载本地/网络字体文件 | ||
* 自定义界面中各类元素字体列表 | ||
|
||
* `基础字体`: 界面使用的字体 | ||
* `编辑器字体`: 编辑器中使用的字体 | ||
* `代码字体`: 行内代码, 代码块与文本输入框中使用的字体 | ||
* `图表字体`: 关系图使用的字体 | ||
* `数学字体`: 行内公式与公式块使用的字体 | ||
* `表情符号字体`: 表情符号(Emoji, 用于文档图标)使用的字体 | ||
|
||
### 设置项介绍 | ||
|
||
* `常规设置` | ||
|
||
* `重置设置选项` | ||
|
||
* 这是一个按钮 | ||
* 重置所有设置选项为默认选项 | ||
* 点击该按钮后会弹出确认对话框 | ||
|
||
* 点击对话框确认按钮后会重置本插件所有选项为默认选项, 之后会自动刷新当前界面 | ||
* `系统字体列表` | ||
|
||
* 这是一个按钮 | ||
* 查看内核所在系统的字体列表 | ||
* 点击该按钮后会弹出一个显示系统字体列表的对话框 | ||
* `可用字体列表` | ||
|
||
* 这是一个按钮 | ||
* 查看当前应用支持的字体列表 | ||
* 点击该按钮后会弹出一个显示当前可用字体列表的对话框 | ||
|
||
* 最顶层列表项的右侧显示该字体族的引用名称, 自定义字体时需要使用该名称 | ||
* 最顶层列表项展开后可以查看该字体族中所有样式的字体 | ||
* `CSS 片段` | ||
|
||
* `启用` | ||
|
||
* 这是一个开关 | ||
* 默认状态: *打开* | ||
* 开关打开后会将该设置项下方的 CSS 代码片段应用到当前界面 | ||
* `CSS 片段` | ||
|
||
* 这是一个文本输入框 | ||
* 默认注册了一个 `@font-face` 规则, 用于加载插件中附带的 [Twemoji Mozilla](https://github.com/mozilla/twemoji-colr) 表情符号字体 | ||
* 详情请参考: [@font-face - CSS:层叠样式表 | MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face) | ||
* `字体设置` | ||
|
||
* 字体列表需要使用字体族名称指定字体 | ||
|
||
* 例如 `微软雅黑` 的字体族名称为 `Microsoft YaHei` | ||
* 当前应用支持的字体族可以在 `常规设置` > `可用字体列表` 中查看 | ||
* 字体列表每行设置一个字体族名称, 越靠前的字体优先级越高 | ||
* `基础字体`: 界面使用的字体 | ||
|
||
* 在该选项卡中可以自定义编辑器以外的文本所使用的字体列表 | ||
* `编辑器字体`: 编辑器中使用的字体 | ||
|
||
* 在该选项卡中可以自定义编辑器中文本所使用的字体列表 | ||
* 在桌面端中本字体列表优先级低于 `思源设置`→`编辑器`→`字体` 设置项 | ||
|
||
* 若需要在桌面端中应用本字体列表, 可以将 `思源设置`→`编辑器`→`字体` 设置项设置为 `默认` | ||
* `代码字体`: 行内代码, 代码块与文本输入框中使用的字体 | ||
|
||
* 在该选项卡中可以自定义编辑器中 `行内代码`, `代码块` 以及 `文本输入框` 中文本所使用的字体 | ||
* `图表字体`: 关系图使用的字体 | ||
|
||
* 在该选项卡中可以自定义关系图中文本所使用的字体 | ||
* `数学字体`: 行内公式与公式块使用的字体 | ||
|
||
* 在该选项卡中可以自定义编辑器中 `行内公式` 与 `数学公式块` 中文本所使用的字体 | ||
* `表情符号字体`: 表情符号(Emoji, 用于文档图标)使用的字体 | ||
|
||
* 在该选项卡中可以自定义文档图标中的表情符号所使用的字体 | ||
* `菜单设置` | ||
|
||
* `块字体列表` | ||
|
||
* 这是一个文本输入框 | ||
* 文本框的的每一行指定一个字体名称, 可以使用块菜单设置块的字体为该字体 | ||
|
||
## 更改日志 | ||
|
||
[CHANGELOG.md](https://github.com/Zuoqiu-Yingyi/siyuan-plugin-custom-fonts/blob/main/CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"displayName": "Custom Fonts", | ||
"menu": { | ||
"allFonts": { | ||
"label": "All Fonts" | ||
}, | ||
"clearFontStyle": { | ||
"label": "Clear Font Style" | ||
}, | ||
"customBlockFont": { | ||
"label": "Custom Block Font" | ||
} | ||
}, | ||
"message": { | ||
"loading": "Loading...", | ||
"notSupportQueryLocalFonts": "The current app doesn't support querying local fonts!" | ||
}, | ||
"settings": { | ||
"cssSettings": { | ||
"enable": { | ||
"description": "Enable this CSS snippet", | ||
"title": "Enable" | ||
}, | ||
"snippet": { | ||
"description": "CSS code snippet that can use <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face'>@font-face</a> to dynamically load font files", | ||
"placeholder": "Enter CSS code snippet here", | ||
"title": "CSS Snippet" | ||
}, | ||
"title": "CSS Snippet" | ||
}, | ||
"fontsSettings": { | ||
"base": { | ||
"enable": { | ||
"description": "Enable custom base font list, use theme-defined base font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom base font list, one font name per line", | ||
"placeholder": "Enter custom base font list here", | ||
"title": "Custom Base Font List" | ||
}, | ||
"title": "Base Font" | ||
}, | ||
"code": { | ||
"enable": { | ||
"description": "Enable custom code font list, use theme-defined code font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom code font list, one font name per line", | ||
"placeholder": "Enter custom code font list here", | ||
"title": "Custom Code Font List" | ||
}, | ||
"title": "Code Font" | ||
}, | ||
"editor": { | ||
"enable": { | ||
"description": "Enable custom editor font list, use theme-defined editor font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom editor font list, one font name per line", | ||
"placeholder": "Enter custom editor font list here", | ||
"title": "Custom Editor Font List" | ||
}, | ||
"title": "Editor Font" | ||
}, | ||
"emoji": { | ||
"enable": { | ||
"description": "Enable custom emoji font list, use theme-defined emoji font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom emoji font list, one font name per line", | ||
"placeholder": "Enter custom emoji font list here", | ||
"title": "Custom Emoji Font List" | ||
}, | ||
"title": "Emoji Font" | ||
}, | ||
"graph": { | ||
"enable": { | ||
"description": "Enable custom graph font list, use theme-defined graph font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom graph font list, one font name per line", | ||
"placeholder": "Enter custom graph font list here", | ||
"title": "Custom Graph Font List" | ||
}, | ||
"title": "Graph Font" | ||
}, | ||
"math": { | ||
"enable": { | ||
"description": "Enable custom math font list, use theme-defined math font list if disabled", | ||
"title": "Enable" | ||
}, | ||
"fontsList": { | ||
"description": "Custom math font list, one font name per line", | ||
"placeholder": "Enter custom math font list here", | ||
"title": "Custom Math Font List" | ||
}, | ||
"title": "Math Font" | ||
}, | ||
"preview": { | ||
"description": "Preview Font Styles", | ||
"placeholder": "Please enter the text to preview here", | ||
"title": "Font Preview" | ||
}, | ||
"title": "Font Settings" | ||
}, | ||
"generalSettings": { | ||
"reset": { | ||
"description": "Reset all settings options to default settings (page will refresh after reset)", | ||
"text": "Reset", | ||
"title": "Reset Settings Options" | ||
}, | ||
"showSystemFonts": { | ||
"description": "Displays a list of fonts for the system on which the kernel resides", | ||
"text": "View", | ||
"title": "The List of System Fonts" | ||
}, | ||
"showUsableFonts": { | ||
"description": "Displays a list of available fonts currently", | ||
"text": "View", | ||
"title": "The List of Usable Fonts" | ||
}, | ||
"title": "General Settings" | ||
}, | ||
"menuSettings": { | ||
"blockFontList": { | ||
"description": "Use the block menu to quickly set the font of block, one font name per line, please refer to <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-family'>font-family</a> for the name format", | ||
"placeholder": "Please enter a list of custom fonts here", | ||
"title": "Block Font List" | ||
}, | ||
"title": "Menu Settings" | ||
} | ||
} | ||
} |
Oops, something went wrong.