public Type0CidFont(ICidFontProgram fontProgram, NameToken type, NameToken subType, NameToken baseFont, CharacterIdentifierSystemInfo systemInfo, FontDescriptor descriptor, VerticalWritingMetrics verticalWritingMetrics, IReadOnlyDictionary <int, double> widths, double?defaultWidth) { this.fontProgram = fontProgram; this.verticalWritingMetrics = verticalWritingMetrics; this.defaultWidth = defaultWidth; Type = type; SubType = subType; BaseFont = baseFont; SystemInfo = systemInfo; var scale = 1 / (double)(fontProgram?.GetFontMatrixMultiplier() ?? 1000); FontMatrix = TransformationMatrix.FromValues(scale, 0, 0, scale, 0, 0); Descriptor = descriptor; Widths = widths; }
public Type2CidFont(NameToken type, NameToken subType, NameToken baseFont, CharacterIdentifierSystemInfo systemInfo, FontDescriptor descriptor, ICidFontProgram fontProgram, VerticalWritingMetrics verticalWritingMetrics, IReadOnlyDictionary <int, double> widths, double?defaultWidth, CharacterIdentifierToGlyphIndexMap cidToGid) { Type = type; SubType = subType; BaseFont = baseFont; SystemInfo = systemInfo; Descriptor = descriptor; this.fontProgram = fontProgram; this.verticalWritingMetrics = verticalWritingMetrics; this.widths = widths; this.defaultWidth = defaultWidth; this.cidToGid = cidToGid; // TODO: This should maybe take units per em into account? var scale = 1 / (double)(fontProgram?.GetFontMatrixMultiplier() ?? 1000); FontMatrix = TransformationMatrix.FromValues(scale, 0, 0, scale, 0, 0); }