Baidu Editor is an editor that is often used in the development process. Because its functions are similar to Word, it is used by many developers to develop various projects. However, sometimes it encounters some special situations, such as small The editor recently encountered a client from a higher education institution who required that articles published on the website must be in imitation Song fonts or national standard imitation Song fonts, that is, "Imitation Song" and "Imitation Song GB2312", but the official version of Baidu Rich Text Editor is not available. The two fonts "Fang Song" and "Fang Song GB2312" are not provided.
After consulting various materials, the editor summarized how to add two fonts, "Fang Song" and "Fang Song GB2312", in Baidu Editor, as shown below.
First of all, before adding the two fonts "Fake Song" and "Fake Song GB2312", we need to know and understand how these two fonts are represented in the development application. The fonts in the official documents are As follows:
'songti':'宋体', 'kaiti':'楷体', 'heiti':'黑体', 'lishu':'隶书', '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 during the development process often has its own way of expression. Through searching, the editor summarized the ways in which some commonly used fonts are expressed during the development process, as follows Display:
华文细黑:STHeiti Light [STXihei] 华文黑体:STHeiti 华文楷体:STKaiti 华文宋体:STSong 华文仿宋:STFangsong 俪黑 Pro:LiHei Pro Medium 俪宋 Pro:LiSong Pro Light 标楷体:BiauKai 苹果俪中黑:Apple LiGothic Medium 苹果俪细宋:Apple LiSung Light 新细明体:PMingLiU 细明体:MingLiU 标楷体:DFKai-SB 黑体:SimHei 宋体:SimSun 新宋体:NSimSun 仿宋:FangSong 楷体:KaiTi 仿宋_GB2312:FangSong_GB2312 楷体_GB2312:KaiTi_GB2312 微软正黑体:Microsoft JhengHei 微软雅黑体:Microsoft YaHei 隶书:LiSu 幼圆:YouYuan 华文细黑:STXihei 华文楷体:STKaiti 华文宋体:STSong 华文中宋:STZhongsong 华文仿宋:STFangsong 方正舒体:FZShuTi 方正姚体:FZYaoti 华文彩云:STCaiyun 华文琥珀:STHupo 华文隶书:STLiti 华文行楷:STXingkai 华文新魏:STXinwei
From here, we can easily see that the display methods of "FangSong" and "FangSong GB2312" during the development process are: FangSong and FangSong_GB2312 respectively, so what we need to do next is Just add these two fonts to the corresponding locations in 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, add "imitate Song" and "Fake Song GB2312" fonts FangSong and FangSong_GB2312
'fontfamily':{ 'songti':'宋体', 'kaiti':'楷体', 'heiti':'黑体', 'FangSong ': '仿宋', 'FangSong_GB2312': '仿宋_GB2312', 'lishu':'隶书', 'yahei':'微软雅黑', 'andaleMono':'andale mono', 'arial': 'arial', 'arialBlack':'arial black', 'comicSansMs':'comic sans ms', 'impact':'impact', 'timesNewRoman':'times new roman' },
2. Find the file ueditor\ueditor.config.js (I also saw it on the Internet saying it is ueditor\editor_config.js, maybe a version problem), find it The commented out fontfamily node is about line 180. Remove the comment of this node and add the fonts FangSong and FangSong_GB2312
,'fontfamily':[ { label:'',name:'songti',val:'宋体,SimSun'}, { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'}, { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'}, { label:'',name:'heiti',val:'黑体, SimHei'}, { label: '', name: 'SimSun', val: '仿宋,SimSun' }, { label:'',name:'FangSong_GB2312',val:'仿宋_GB2312 ,FangSong_GB2312'}, { label:'',name:'lishu',val:'隶书, 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'} ]
of "Fake Song" and "Fake Song GB2312". This will appear when you edit the article again. There are two fonts: "Imitation Song" and "Imitation Song GB2312". Friends who need it can try it. I hope it will be helpful to you.
Related recommendations: "PHP Video Tutorial"
The above is the detailed content of How to add 'Fake Song' and 'Fake Song GB2312' in Baidu Editor. For more information, please follow other related articles on the PHP Chinese website!

This article details implementing message queues in PHP using RabbitMQ and Redis. It compares their architectures (AMQP vs. in-memory), features, and reliability mechanisms (confirmations, transactions, persistence). Best practices for design, error

This article examines current PHP coding standards and best practices, focusing on PSR recommendations (PSR-1, PSR-2, PSR-4, PSR-12). It emphasizes improving code readability and maintainability through consistent styling, meaningful naming, and eff

This article details installing and troubleshooting PHP extensions, focusing on PECL. It covers installation steps (finding, downloading/compiling, enabling, restarting the server), troubleshooting techniques (checking logs, verifying installation,

This article explains PHP's Reflection API, enabling runtime inspection and manipulation of classes, methods, and properties. It details common use cases (documentation generation, ORMs, dependency injection) and cautions against performance overhea

PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

This article explores strategies for staying current in the PHP ecosystem. It emphasizes utilizing official channels, community forums, conferences, and open-source contributions. The author highlights best resources for learning new features and a

This article explores asynchronous task execution in PHP to enhance web application responsiveness. It details methods like message queues, asynchronous frameworks (ReactPHP, Swoole), and background processes, emphasizing best practices for efficien

This article addresses PHP memory optimization. It details techniques like using appropriate data structures, avoiding unnecessary object creation, and employing efficient algorithms. Common memory leak sources (e.g., unclosed connections, global v


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 English version
Recommended: Win version, supports code prompts!
