// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
#if DEBUG
using System.Text;
#endif
namespace SixLabors.Fonts.Tables.Cff {
///
/// Represents a single key-value entry parsed from a CFF DICT structure.
/// The key is a and the value is an array of .
///
internal class CffDataDicEntry
{
///
/// Initializes a new instance of the class.
///
/// The DICT operator.
/// The operand values for this operator.
public CffDataDicEntry(CFFOperator @operator, CffOperand[] operands)
{
this.Operator = @operator;
this.Operands = operands;
}
///
/// Gets the DICT operator that identifies this entry.
///
public CFFOperator Operator { get; }
///
/// Gets the operand values associated with this operator.
///
public CffOperand[] Operands { get; }
#if DEBUG
///
public override string ToString()
{
StringBuilder builder = new();
int j = this.Operands.Length;
for (int i = 0; i < j; ++i)
{
if (i > 0)
{
builder.Append(' ');
}
builder.Append(this.Operands[i].ToString());
}
builder.Append(' ')
.Append(this.Operator?.ToString() ?? string.Empty);
return builder.ToString();
}
#endif
}
}