Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add "imitating Song" and "imitating Song GB2312" to Baidu Editor

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to add "imitating Song" and "imitating Song GB2312" in Baidu editor. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Baidu editor is an editor that is often used in the development process. Because its function is similar to Word, it is used by many developers in various projects, but sometimes it encounters some special situations. For example, recently, a customer of an university asked that the article published on the website must be imitated Song font or national standard imitated Song font, that is, "imitating Song" and "imitating Song GB2312". However, Baidu rich text editor, the official version does not provide "imitating Song" and "imitating Song GB2312" these two fonts.

By consulting various materials, the editor summarizes how to add "imitating Song" and "imitating Song GB2312" to the Baidu editor, as shown below.

First of all, before adding "imitating Song" and "imitating Song GB2312" fonts, we need to know and understand how these two fonts are represented in development applications. The fonts in the official documents are as follows:

'songti':' Arial', 'kaiti':' italics', 'heiti':' boldface', 'lishu':' official script', 'yahei':' Microsoft Yahei', 'andaleMono':'andale mono','arial':' arial','arialBlack':'arial black','comicSansMs':'comic sans ms','impact':'impact','timesNewRoman':'times new roman'

It is not difficult to find that the use of fonts in the development process often has its own expression. Through search, the editor summarizes the representation of some commonly used fonts in the development process, as follows:

Chinese fine black: STHeiti Light [STXihei] Chinese bold: STHeiti Chinese Arial: STKaiti Chinese Song: STSong Chinese Song: STFangsong Black Pro:LiHei Pro Medium Song Pro:LiSong Pro Light Standard body: BiauKai Apple weight Black: Apple LiGothic Medium Apple weight Song: Apple LiSung Light New thin body: PMingLiU thin body: MingLiU Standard Type: DFKai-SB bold: SimHei Song: SimSun New Song: NSimSun Song: FangSong style: KaiTi Song _ GB2312:FangSong_GB2312 Kai Body _ GB2312:KaiTi_GB2312: Microsoft JhengHei Microsoft bold: Microsoft YaHei official script: LiSu young circle: YouYuan Chinese fine black: STXihei Chinese typeface: STKaiti Chinese Song style: STSong Chinese Middle Song: STZhongsong Chinese imitation Song: STFangsong founder comfortable style: FZShuTi founder Yao style: FZYaoti Chinese Caiyun: STCaiyun Chinese Amber: STHupo Chinese official script: STLiti Chinese script: STXingkai Chinese New Wei:

From here, it is not difficult to see that the display modes of "imitating Song" and "imitating Song GB2312" in the development process are: FangSong and FangSong_GB2312, respectively, so the next thing we need to do is to add these two fonts to the corresponding location of Baidu rich text editor.

The process is as follows:

1. Find the file ueditor/lang/zh-cn/zh-cn.js, find the fontfamily node in it, and add the fonts FangSong and FangSong_GB2312 of "imitating Song" and "imitating Song GB2312".

'fontfamily': {' songti':' Arial', 'kaiti':' boldface', 'heiti':' boldface', 'FangSong': 'imitating Song', 'FangSong_GB2312':' imitating Song _ GB2312', 'lishu':' official script', 'yahei':' Microsoft Yahei', 'andaleMono':'andale mono',' arial': 'arial',' arialBlack':'arial black' 'comicSansMs':'comic sans ms', 'impact':'impact',' timesNewRoman':'times new roman'}

two。 Find the file ueditor\ ueditor.config.js file (also see on the Internet that it is a ueditor\ editor_config.js file, which may have a version problem), find the fontfamily node that has been commented out, about 180 lines, remove the comments from this node, and add the fonts FangSong and FangSong_GB2312 of "imitating Song" and "imitating Song GB2312".

, 'fontfamily': [{label:'',name:'songti',val:' boldface, SimSun'}, {label:'',name:'kaiti',val:' italics, _ GB2312, SimKai'}, {label:'',name:'yahei',val:' Microsoft Jahi, Microsoft YaHei'}, {label:'',name:'heiti',val:' boldface, SimHei'}, {label:'',name:' SimSun' Val:' imitating Song, SimSun'}, {label:'',name:'FangSong_GB2312',val:' imitating Song _ GB2312, FangSong_GB2312'}, {label:'',name:'lishu',val:' official script, SimLi'}, {label:'',name:'andaleMono',val:'andale mono'}, {label:'',name:'arial',val:'arial, helvetica,sans-serif'}, {label:'',name:'arialBlack' Val:'arial black,avant garde'}, {label:'',name:'comicSansMs',val:'comic sans ms'}, {label:'',name:'impact',val:'impact,chicago'}, {label:'',name:'timesNewRoman',val:'times new roman'}]

In this way, when editing the article again, there will be two fonts: "imitating Song" and "imitating Song GB2312". Friends who need it can try it. I hope it will be helpful to you.

This is the end of the article on "how to add" imitating Song "and" imitating Song GB2312 "in Baidu editor. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report