What if you designers want to use the font below as the title font in some special events? Make it into a picture. Then you may encounter the following problems: adaptation to different screens. If you only make pictures of one size, the effect will not be very good after zooming in or out. Directly into SVG? It seems that it is impossible to copy it into Word and make it bold. In other words, this method makes the "text" itself lose the ability that real text should have. This is where the benefits of colored fonts come into play. It not only meets the requirements of visual effects, but also has the functions of regular text. It can be copied, pasted, and read by screen readers without interfering with regular operations.
What is Color Font? First Look at Color Fonts In the traditional fonts we are familiar with, the font file itself only describes the font's appearance features, which generally include vector outline data or monochrome bitmap data. When a browser renders a monochrome font, the rendering engine fills the glyph area with the set font color and finally draws the corresponding text and its set color. Color fonts not only store the font's appearance features, but also the color information, and can even provide different color schemes in the font, which increases flexibility and provides richer appearance details. The most common color fonts in daily use are Emoji expressions. For example, on Windows 10, Segoe UI Emoji is a color font. Usually color fonts also contain some compatibility information, which includes Unicode-encoded monochrome glyph data, so that on some platforms that do not support color fonts, the glyphs of color fonts can still be rendered like ordinary fonts, achieving a backward compatibility effect. Implementation standards for color fonts In the history of color font design, each company has its own implementation plan, resulting in different standards for color information embedded in OpenType fonts. In the latest OpenType standard, there are up to four description formats for color font data.
Browser support for various standards
Seeing so many standards and uneven browser support, you may wonder if we need to distribute fonts in different formats according to UA for compatibility? Goodbye! Wait a minute, young man! In 2016, major manufacturers finally agreed to use OpenType SVG as the standard for color fonts, which is the SVG mentioned above, and is also the standard currently used by W3C . I believe that in the near future browsers from all major manufacturers will gradually support the SVG standard used by W3C. Current status of font module standards CSS Fonts Module Level 3: Currently in the candidate recommendation state, it is a standard that has been largely implemented by mainstream browsers. The latest version of the candidate standard was published on June 26 this year. The Level 3 standard is based on the previous CSS3 Fonts and CSS3 Web Fonts, and moves the standards related to font loading events into the CSS Font Loading module. CSS Fonts Module Level 4: The next generation standard of Level 3, currently in the working group draft state, the latest draft was updated on April 10. This draft version is based on Level 3, and the new attributes added include support for color fonts, which will be introduced in this article. CSS Color Fonts In browsers that support color fonts, they will render correctly, but you will not be able to control the use of other colors built into the font. In the Level 4 standard, some new standards related to color fonts have been added to enable us to use them better. Let’s take a look at it next. Choose font color: font-palette We have learned earlier that color fonts can have a variety of different color schemes through the CPAL table.
Example: h1 { font-family: Segoe UI Emojil font-palette: light } Custom font color: @font-palette-values Its basic definition rule is The following is an explanation of three key attributes. font-family First of all, when setting the color scheme for a font, we must first specify which font the color scheme information is set on. The current color configuration can be bound to a font through @font-palette-values Snow { font-family: TriColor; } base-palette When authors create colored fonts, they often build in a variety of font color schemes. When storing this information, each different color scheme has its own corresponding @font-palette-values Snow { font-family: TriColor; base-palette: 5; } color-x Image credit: typography.guru The image above shows how COLR layers glyphs. COLR separates the parts of a glyph into layers and merges the layers into a complete font in a specific order. Each layer is colored using the color information in CPAL. In order to achieve more powerful customization effects, @font-palette-values RedSnow { font-family: TriColor; base-palette: 5; color-1: rgb(255, 0, 0); } The above example shows how to copy the layer color through Other notable new attributes of Level 4 font-min-size, font-max-size As the property names suggest, these two properties will constrain the final value of Summarize There are quite a lot of interesting new features in Fonts Module Level 4. The specific effects and standard improvements can only be known after major browsers begin to support it. Let us wait and see. Links in this article https://docs.microsoft.com/en-us/typography/opentype/spec/otff References https://www.w3.org/TR/css-fonts-4/ The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Detailed explanation of Vue's front-end system and front-end and back-end separation
>>: mysql implements the operation of setting multiple primary keys
The detailed process of installing python3.7.0 on...
Preface I believe everyone has used the top comma...
Crontab is a command used to set up periodic exec...
Table of contents Mainly used Postman functions D...
Due to the initial partitioning of the system, th...
environment Host IP 192.168.0.9 Docker version 19...
What is an index? An index is a data structure th...
SQL paging query:background In the company's ...
Preface This article mainly introduces the releva...
In MySQL, database garbled characters can general...
Table of contents 1. Stop MySQL Server first 2. U...
This article shares the detailed steps of install...
The picture is used as the background and the lin...
ins and del were introduced in HTML 4.0 to help au...
Nine simple examples analyze the use of HTML form...