Exemple #1
0
        public Type0CidFont(ICidFontProgram fontProgram, NameToken type, NameToken subType, NameToken baseFont,
                            CharacterIdentifierSystemInfo systemInfo,
                            FontDescriptor descriptor, IReadOnlyDictionary <int, decimal> widths)
        {
            this.fontProgram = fontProgram;
            Type             = type;
            SubType          = subType;
            BaseFont         = baseFont;
            SystemInfo       = systemInfo;
            var scale = 1 / (decimal)(fontProgram?.GetFontMatrixMultiplier() ?? 1000);

            FontMatrix = TransformationMatrix.FromValues(scale, 0, 0, scale, 0, 0);
            Descriptor = descriptor;
            Widths     = widths;
        }
Exemple #2
0
        public Type2CidFont(NameToken type, NameToken subType, NameToken baseFont, CharacterIdentifierSystemInfo systemInfo,
                            FontDescriptor descriptor, ICidFontProgram fontProgram,
                            VerticalWritingMetrics verticalWritingMetrics,
                            IReadOnlyDictionary <int, decimal> widths)
        {
            Type                        = type;
            SubType                     = subType;
            BaseFont                    = baseFont;
            SystemInfo                  = systemInfo;
            Descriptor                  = descriptor;
            this.fontProgram            = fontProgram;
            this.verticalWritingMetrics = verticalWritingMetrics;
            this.widths                 = widths;

            // TODO: This should maybe take units per em into account?
            var scale = 1 / 1000m;

            FontMatrix = TransformationMatrix.FromValues(scale, 0, 0, scale, 0, 0);
        }
Exemple #3
0
        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;
        }
Exemple #4
0
        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);
        }