typora是一款非常方便的書寫markdown文本的編輯器。
typora字體更改步驟如下:
1.打開Typora軟件,主題選擇night
文件 >> 偏好設置 >> 打開主題文件夾
上面的幾個css文件就是對應主題的css,用哪個主題就要配置哪個文件,我喜歡用的是night.css
2.配置.css
在night.css文件中增加微軟雅黑字體和CONSOLAS字體的配置,即在原有的基礎上增加 Consolas,"Microsoft Yahei"
textarea { font-family: Consolas,"Microsoft Yahei","Helvetica Neue", Helvetica, Arial, sans-serif; }
font-family代表此處控制的是字體,一種逗號代表一個字體,這里我們寫了6個字體,我們這句話的意思就是遇到一個字體,如果是英文選用Consolas,因為它在前面,如果是中文就選用Microsoft Yahei(微軟雅黑)字體,Consolas是不包含中文字體的
3. 源碼模式字體的修改
文件 >> 偏好設置 >> 打開高級設置
conf.user.json文件配置更改 上面幾行字體設置好即可
/** For advanced users. */ { "defaultFontFamily": { "standard": "Microsoft Yahei", //String - Defaults to "Times New Roman". "serif": "Microsoft Yahei", // String - Defaults to "Times New Roman". "sansSerif": "Consolas", // String - Defaults to "Arial". "monospace": "Consolas" // String - Defaults to "Courier New". }, "autoHideMenuBar": false, //Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is false. // Array - Search Service user can access from context menu after a range of text is selected. Each item is formatted as [caption, url] "searchService": [ ["Search with Google", "https://google.com/search?q=%s"] ], // Custom key binding, which will override the default ones. "keyBinding": { // for example: // "Always on Top": "Ctrl+Shift+P" }, "monocolorEmoji": false, //default false. Only work for Windows "autoSaveTimer" : 3, // Deprecidated, Typora will do auto save automatically. default 3 minutes "maxFetchCountOnFileList": 500, "flags": [] // default [], append Chrome launch flags, e.g: [["disable-gpu"], ["host-rules", "MAP * 127.0.0.1"]] }
保存重啟即可。無論是在源碼模式,還是在預覽模式,我們的Typora,中文字體始終是微軟雅黑,英文字體始終是Consolas。
參見:https://www.freesion.com/article/119965701/