// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. #if DEBUG using System.Globalization; #endif namespace SixLabors.Fonts.Tables.Cff { /// /// Represents a numeric operand value from a CFF DICT entry. /// Operands can be integers or real numbers as encoded in the DICT data. /// internal readonly struct CffOperand { /// /// Initializes a new instance of the struct. /// /// The numeric value. /// The operand kind (integer or real). public CffOperand(double number, OperandKind kind) { this.Kind = kind; this.RealNumValue = number; } /// /// Gets the kind of this operand (integer or real number). /// public readonly OperandKind Kind { get; } /// /// Gets the numeric value of this operand. /// public readonly double RealNumValue { get; } #if DEBUG /// public override string ToString() => this.Kind switch { OperandKind.IntNumber => ((int)this.RealNumValue).ToString(CultureInfo.InvariantCulture), _ => this.RealNumValue.ToString(CultureInfo.InvariantCulture), }; #endif } }