Text Vectorization & Text Security | .NET

Contents
[ ]

Text “Banner Text to Vector”

The text elements are closely related to the concept of font, glyph and symbol. When a computer renders characters, it maps those characters to glyphs in a font.

In the vectorized SVG text, all font glyphs are replaced with the combination of <path>, <use>, <mask>, <g> elements, and etc. When you convert text to a vector path, you will no longer be able to edit the text in a text editor. Thus, text vectorization serves as some text security from unwanted using, borrowing, and editing. But, you will be able to edit the vector paths. Keep in mind that the text is no longer saved as a font, it became a vector object. This will allow you to create logos or wordmarks, combine multiple paths into a single, reduce the file size, etc.

Text vectorization can be useful in cases where unique fonts are applied to the text, which are not installed on the user’s configuration. Vectorized SVG text retains its style (font) when getting in any computer environment, whether this font is installed or not. This is why that fonts within most vector logos containing text are converted to outlines.

The vectorized text, being a digital graphic, can be scaled with saving quality. The “filter”, “mask”, “opacity”, and other effects can be applied to the vectorized SVG text. Vectorization also results in the reduction of the generated SVG Document.

Aspose.SVG for .NET API provides the feature of vectorizing text elements in SVG documents. To vectorize text, set the VectorizeText property of the SVGSaveOptions class to true.

The following code snippet demonstrates the use of the VectorizeText property for text vectorization in text.svg file:

using System.IO;
using Aspose.Svg;
using Aspose.Svg.Saving;
...
    
    // Load an SVG document from a file
    var document = new SVGDocument(Path.Combine(DataDir, "text.svg"));

    // Set text elements vectorization 
    var saveOptions = new SVGSaveOptions
    {
        VectorizeText = true
    };
    
    // Save the SVG document with specified saveOptions
    document.Save(Path.Combine(OutputDir, "text_vectorized.svg"), saveOptions);

The vectorized text, being a digital graphic, has some advantages:

  • can be scaled with saving quality;

  • results in the reduction of the generated SVG document;

  • retains its style when used in any computer environment;

  • serves the text security from unwanted using, borrowing, and editing.