Home Backend Development PHP Problem How to add 'Fake Song' and 'Fake Song GB2312' in Baidu Editor

How to add 'Fake Song' and 'Fake Song GB2312' in Baidu Editor

Feb 12, 2022 pm 02:26 PM

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'
Copy after login

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
Copy after login

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'
},
Copy after login

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'}
]
Copy after login

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8 JIT (Just-In-Time) Compilation: How it improves performance. PHP 8 JIT (Just-In-Time) Compilation: How it improves performance. Mar 25, 2025 am 10:37 AM

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

OWASP Top 10 PHP: Describe and mitigate common vulnerabilities. OWASP Top 10 PHP: Describe and mitigate common vulnerabilities. Mar 26, 2025 pm 04:13 PM

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP Secure File Uploads: Preventing file-related vulnerabilities. PHP Secure File Uploads: Preventing file-related vulnerabilities. Mar 26, 2025 pm 04:18 PM

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

PHP Encryption: Symmetric vs. asymmetric encryption. PHP Encryption: Symmetric vs. asymmetric encryption. Mar 25, 2025 pm 03:12 PM

The article discusses symmetric and asymmetric encryption in PHP, comparing their suitability, performance, and security differences. Symmetric encryption is faster and suited for bulk data, while asymmetric is used for secure key exchange.

PHP Authentication & Authorization: Secure implementation. PHP Authentication & Authorization: Secure implementation. Mar 25, 2025 pm 03:06 PM

The article discusses implementing robust authentication and authorization in PHP to prevent unauthorized access, detailing best practices and recommending security-enhancing tools.

PHP CSRF Protection: How to prevent CSRF attacks. PHP CSRF Protection: How to prevent CSRF attacks. Mar 25, 2025 pm 03:05 PM

The article discusses strategies to prevent CSRF attacks in PHP, including using CSRF tokens, Same-Site cookies, and proper session management.

How do you retrieve data from a database using PHP? How do you retrieve data from a database using PHP? Mar 20, 2025 pm 04:57 PM

Article discusses retrieving data from databases using PHP, covering steps, security measures, optimization techniques, and common errors with solutions.Character count: 159

PHP API Rate Limiting: Implementation strategies. PHP API Rate Limiting: Implementation strategies. Mar 26, 2025 pm 04:16 PM

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

See all articles