// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Drawing { /// /// Options for influencing the drawing functions. /// public struct TextGraphicsOptions { /// /// Represents the default . /// public static readonly TextGraphicsOptions Default = new TextGraphicsOptions(true); /// /// Whether antialiasing should be applied. /// public bool Antialias; /// /// Whether the text should be drawing with kerning enabled. /// public bool ApplyKerning; /// /// The number of space widths a tab should lock to. /// public float TabWidth; /// /// Initializes a new instance of the struct. /// /// If set to true [enable antialiasing]. public TextGraphicsOptions(bool enableAntialiasing) { this.Antialias = enableAntialiasing; this.ApplyKerning = true; this.TabWidth = 4; } /// /// Performs an implicit conversion from to . /// /// The options. /// /// The result of the conversion. /// public static implicit operator TextGraphicsOptions(GraphicsOptions options) { return new TextGraphicsOptions(options.Antialias); } /// /// Performs an explicit conversion from to . /// /// The options. /// /// The result of the conversion. /// public static explicit operator GraphicsOptions(TextGraphicsOptions options) { return new GraphicsOptions(options.Antialias); } } }