// ReSharper disable RedundantDefaultMemberInitializer
namespace UglyToad.PdfPig.Graphics
{
using Core;
using Cos;
using PdfPig.Core;
///
/// The current state of text related parameters for a content stream.
///
internal class CurrentFontState : IDeepCloneable
{
///
/// A value in unscaled text space units which is added to the horizontal (or vertical if in vertical writing mode)
/// glyph displacement.
///
///
/// In horizontal writing mode a positive value will expand the distance between letters/glyphs.
/// Default value 0.
///
public decimal CharacterSpacing { get; set; } = 0;
///
/// As for but applies only for the space character (32).
///
///
/// Default value 0.
///
public decimal WordSpacing { get; set; } = 0;
///
/// Adjusts the width of glyphs/letters by stretching (or compressing) them horizontally.
/// Value is a percentage of the normal width.
///
public decimal HorizontalScaling { get; set; } = 100;
///
/// The vertical distance in unscaled text space units between the baselines of lines of text.
///
public decimal Leading { get; set; }
public CosName FontName { get; set; }
public decimal FontSize { get; set; }
///
/// The for glyph outlines.
///
///
/// When the rendering mode requires filling the current non-stroking color in the state is used.
/// When the rendering mode requires stroking the current stroking color in the state is used.
/// The rendering mode has no impact on Type 3 fonts.
///
public RenderingMode RenderingMode { get; set; } = RenderingMode.Fill;
///
/// The distance in unscaled text space units to move the default baseline either up or down.
///
///
/// Always applies to the vertical coordinate irrespective or writing mode.
///
public decimal Rise { get; set; }
///
/// Are all glpyhs in a text object treated as a single elementary object for the purpose of the transparent imaging model?
///
public bool Knockout { get; set; }
public CurrentFontState DeepClone()
{
return new CurrentFontState
{
CharacterSpacing = CharacterSpacing,
RenderingMode = RenderingMode,
Rise = Rise,
Leading = Leading,
WordSpacing = WordSpacing,
FontName = FontName,
FontSize = FontSize,
HorizontalScaling = HorizontalScaling,
Knockout = Knockout
};
}
}
}