I have done some research on "embedding non-system built-in fonts in web pages" before. Although it is technically feasible, it does not have much practical significance in China, because a Chinese font file is at least 20M+, and the font files supported by each browser are different. In other words, there must be 2-3 font files of different formats on the server side to cope with each browser. You can see the corresponding picture below. I thought this little research I did before would not be useful in my future work, but it turned out to be useful. A customer requested to display the time, but the font of the time must be the same as that of a digital watch, as shown in the figure: First of all, we need to find this font. Since this font is only in ttf format, we need to convert it into various other formats. As for how to convert, there are software and online. I will not specify which one to use here. After the conversion, you can write the CSS code Copy code The code is as follows:@font-face { font-family: 'hooray'; /*Name your custom font*/ src: url('http://demo.jb51.net/js/2013/webfontry/hooray.eot'); src: url('http://demo.jb51.net/js/2013/webfontry/hooray.eot?#iefix') format('eot'), url('http://demo.jb51.net/js/2013/webfontry/hooray.woff') format('woff'), url('http://demo.jb51.net/js/2013/webfontry/hooray.ttf') format('truetype'), url('http://demo.jb51.net/js/2013/webfontry/hooray.svg#webfontjKg17VrE') format('svg'); } As for the call, just like usual, define font-family where needed, and the font name is the name just named: Copy code The code is as follows:font-family: 'hooray'; Download the complete demo. Online Demo I did not explain the reasons for many things in the article, because there is a lot of information on the Internet about "using arbitrary fonts on web pages", but there are few examples. If you don't understand something, just go to Baidu or Google and you will understand. Appendix 1: Two new online font conversion websites are added: FontsQuirrel and onlinefontconverter. |
<<: A brief discussion on how to solve the depends_on order problem in Docker-compose
>>: MySQL learning: five major constraints of database tables explained in detail for beginners
1. Install nginx in docker: It is very simple to ...
This section provides an overview of some other i...
Business scenario: The visitor's visit status...
CSS sets Overflow to hide the scroll bar while al...
This article example shares the implementation me...
It is very convenient to configure virtual host v...
Windows 10 1903 is the latest version of the Wind...
A database index is a data structure whose purpos...
This article example shares the specific code of ...
If you often use FTP server in your study or work...
1. Enter the container docker run [option] image ...
1. Install zabbix-agent on web01 Deploy zabbix wa...
Share a Shell script under Linux to monitor the m...
x-ua-compatible is used to specify the model for ...
This article shares with you the solution to the ...