/// <summary> /// Sets the default shape processing options against the image processing context. /// </summary> /// <param name="context">The image processing context to store default against.</param> /// <param name="optionsBuilder">The action to update instance of the default options used.</param> /// <returns>The passed in <paramref name="context"/> to allow chaining.</returns> public static IImageProcessingContext SetTextOptions(this IImageProcessingContext context, Action <TextOptions> optionsBuilder) { var cloned = context.GetTextOptions().DeepClone(); optionsBuilder(cloned); context.Properties[typeof(TextOptions)] = cloned; return(context); }
/// <summary> /// Gets the default shape processing options against the image processing context. /// </summary> /// <param name="context">The image processing context to retrieve defaults from.</param> /// <returns>The globaly configued default options.</returns> public static TextGraphicsOptions GetTextGraphicsOptions(this IImageProcessingContext context) => new TextGraphicsOptions(context.GetGraphicsOptions(), context.GetTextOptions());