Open In App

Introduction to COLRv1 in Android 13

Last Updated : 26 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

There has been a lot of discussion over the support of the COLRv1 format over the years and finally, after a long haul we finally have COLRv1 making its debut in Android 13, and you can finally use the high-quality graphics and codecs in our program.

What is COLRv1?

The system converts system emojis to the COLRv1 format starting with Android 13 and adds rendering support for COLR version 1 (COLRv1) fonts. The COLRv1 font format is extremely small and displays quickly and precisely at any size. Most apps handle everything automatically, and COLRv1 merely functions. However, we advise testing emoji rendering if your app implements its own text rendering and makes use of the system’s fonts.

On your android device, the text is typically shown using a color that has been set in XML. The font only tells where pixels should go; it does not specify any specific color. Typically, that’s a positive thing. The author has a lot of color options thanks to XML. A glyph may, however, have several colors that collectively represent anything. For instance, have a look at this flag with its saffron white and green stripes. If it were merely drawn in the text’s current color, the saffron, white, and green would not convey the same sense. 

Image #1: Understanding the difference between Standard Bitmap & COLRv1

Image #1: Understanding the difference between Standard Bitmap & COLRv1

What about your previous apps?

You may be wondering what will happen to your current app which has been built prior to Android 13, well Google has a solution in place and you can use it, it works like charm. It is, The majority of Android apps will handle text rendering using COLRv1, but Google advises at least evaluating how emojis render for apps that implement their own text rendering using the system’s fonts.

In terms of expressiveness, COLRv1 is comparable to  SVG Native with the addition of blending and compositing. Solid colors, linear gradients, radial gradients, and sweep/conic gradients are the four different types of color fills. A complete set of translate, rotate, shear, and scale transformations are available in COLRv1 for repositioning and transforming glyph elements. Additionally, it reuses the font’s current shape specification formats and supports several font variations.

What’s newer than standard emojis?

If italic or bold formatting is applied to text that is shown with a non-italic or non-bold font, several apps can simulate italic/oblique or bold appearance. Such simulations could significantly alter how color glyphs seem when used to represent text. When showing color glyphs, applications shouldn’t employ simulations made for non-color glyph rendering.

Shapes, solid color fills, and layering is only a few of the ideas used in the most basic color glyphs. Version 0 of the COLR table offers this set of capabilities. In version 0, a base glyph record describes the color glyph as a series of layers for a certain base glyph. Each layer is described in a layer record and has a solid color fill and a shape (a glyph ID) (a CPAL palette entry). Alpha blending is the only technique used to create the filled forms in the layer stack.

GeekTip: Paint* and PaintVar* pairs are used by some paint formats. In these circumstances, the later style allows for variations in changeable fonts, whereas the former offers a more compact representation with the same graphic capabilities but without variation capability.

Conclusion

Most apps handle everything automatically, and COLRv1 merely functions. However, we advise testing emoji rendering if your app implements its own text rendering and makes use of the system’s fonts.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads