CET Developer Guides
CET and SVG Files
3min
about svg scalable vector graphics (svg) is an open standard of xml based vector image format for defining two dimensional graphics it is supported by most web browsers, and can be created using vector graphics editors like adobe illustrator, inkscape, figma, and more since it is xml based, it can be opened in a text editor to be inspected and edited a vector based graphics format means that visual images are created directly using geometric shapes (mathematics of coordinate geometry) defined on a cartesian plane, such as points, lines, curves, and polygons this is in contrast to raster or bitmap graphics, which represents images using a rectangular grid called pixels vector images have the advantage of being scaled in size without the loss of quality this allows for potential support for bigger screen sizes and higher resolution displays cet support in cet 15 5 major and later, we have introduced support for the use of svg files in our development toolkit, allowing developers to use svg files for ui and icons known limitations the current svg support in cet uses microsoft's direct2d implementation, which supports the svg 1 1 secure static mode https //eur02 safelinks protection outlook com/?url=https%3a%2f%2fwww w3 org%2ftr%2fsvg integration%2f\&data=05%7c02%7chaobin loh%40configura com%7c5fd9246f65bb4e5ca93108dd46172ed8%7c146496bf41ea412f90eb1cf8a3db7e42%7c0%7c0%7c638743787594773018%7cunknown%7ctwfpbgzsb3d8eyjfbxb0eu1hcgkionrydwusilyioiiwljaumdawmcisilaioijxaw4zmiisikfoijoitwfpbcisilduijoyfq%3d%3d%7c0%7c%7c%7c\&sdata=quqa74lfb5lq2bqpcxfnmmpxwdnqujlvd9mrgaobsdq%3d\&reserved=0 features as listed in microsoft's api documentation any element or attribute not included in the documentation is considered unsupported, for example application of css like styles via class attributes in svg this means there are some specific requirements on the code output (markup) of the svg file created by external tools, in order to conform to certain expected standards, or it will not show up properly in cet for example css like styles via class attributes in svg (via \<defs>\<styles> ) is not supported this can be solved by forcing inline style attributes in your svg editor for example, illustrator's svg export options allows for a choice in presentation attributes vs style attributes the \<svg> tag should have explicit width and height params in illustrator, ensure that the "responsive" checkbox is unchecked to export width and height parameters prefer simpler geometries and flattened path elements, for "cleaner exports" to avoid potential issues for example, figma artworks with union or mask operations may render with weird artifacts, and should be converted to vector paths upon export things like fill rule and clip path may cause weirdness, even in browsers consider using tools like svgo or svgomg to cleanup and optimize svg files