-
-
Notifications
You must be signed in to change notification settings - Fork 451
Expand file tree
/
Copy pathDrawableTextEncoding.cs
More file actions
35 lines (29 loc) · 984 Bytes
/
Copy pathDrawableTextEncoding.cs
File metadata and controls
35 lines (29 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using System.Text;
namespace ImageMagick.Drawing;
/// <summary>
/// Encapsulation of the DrawableTextEncoding object.
/// </summary>
public sealed class DrawableTextEncoding : IDrawableTextEncoding, IDrawingWand
{
/// <summary>
/// Initializes a new instance of the <see cref="DrawableTextEncoding"/> class.
/// </summary>
/// <param name="encoding">Encoding to use.</param>
public DrawableTextEncoding(Encoding encoding)
{
Throw.IfNull(encoding);
Encoding = encoding;
}
/// <summary>
/// Gets the encoding of the text.
/// </summary>
public Encoding Encoding { get; }
/// <summary>
/// Draws this instance with the drawing wand.
/// </summary>
/// <param name="wand">The want to draw on.</param>
void IDrawingWand.Draw(DrawingWand wand)
=> wand?.TextEncoding(Encoding);
}