2017-11-26 22:19:42 +00:00
|
|
|
|
namespace UglyToad.Pdf.Graphics.Operations.TextState
|
2017-11-22 18:41:34 +00:00
|
|
|
|
{
|
2017-11-29 22:55:53 +00:00
|
|
|
|
using Content;
|
|
|
|
|
|
|
2017-11-22 18:41:34 +00:00
|
|
|
|
internal class SetWordSpacing : IGraphicsStateOperation
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string Symbol = "Tw";
|
|
|
|
|
|
|
|
|
|
|
|
public string Operator => Symbol;
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Spacing { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public SetWordSpacing(decimal spacing)
|
|
|
|
|
|
{
|
|
|
|
|
|
Spacing = spacing;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-11-29 22:55:53 +00:00
|
|
|
|
public void Run(IOperationContext operationContext, IResourceStore resourceStore)
|
|
|
|
|
|
{
|
|
|
|
|
|
var currentState = operationContext.GetCurrentState();
|
|
|
|
|
|
|
|
|
|
|
|
currentState.FontState.WordSpacing = Spacing;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-11-22 18:41:34 +00:00
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return $"{Spacing} {Symbol}";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|