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 embed arbitrary fonts in a web page through the @ font-face attribute of CSS

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

Share

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

In this article, the editor introduces in detail "how to embed any font in the web page through the @ font-face attribute of CSS". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to embed any font in the web page through the @ font-face attribute of CSS" can help you solve your doubts.

The most common way for art designers to do is to turn the words they want into pictures, which has several obvious drawbacks:

1. It is impossible to use this font on a large scale.

two。 The content of the picture is not easy to modify compared to the use of text.

3. It is not good for SEO (mainstream search engines will not use picture alt content as an effective factor to judge the relevance of web content).

There are some methods to use sIFR technology or javascript/flash hack on the network, but they are tedious or defective to implement.

How to add external fonts?

I added @ font-face code to my wxss, which should generally be supported, but still not. As follows:

[mw_shl_code=css,true]

@ font-face {

Font-family: 'font name'

Src: url (".. /.. / resources/font/UKIJTuzTom.eot")

Font-weight: normal

Font-style: normal

}

[/ mw_shl_code]

Without thinking of other good ways for the time being, we first solved {: 5cm 1373:} in the following way.

It is useless to add a url address to WeChat Mini Programs @ font-face, so the URL address replaces the base64 editor.

1. The external font is ready first. Bi: (UKIJTzTr.ttf Uyghur UKIJ font)

2. Upload fonts in http://transfonter.org/ website, select base64 editor, download after fotmat.

3. There is a style file in the download package that can be added to WXSS when the code is opened.

Read here, this article "how to embed arbitrary fonts in a web page through the @ font-face attribute of CSS" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.

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