Example #1
0
        private void ParseSizes()
        {
            double glyphSpaceToTextSpace = 1000.0; // TODO: PdfFont.ParseSizes: SubType:Type3 Uses a FontMatrix that may not correspond to 1/1000th

            _widths = new Dictionary <char, double>();
            char     firstChar  = (char)_baseData.GetParamAsInt("FirstChar");
            char     lastChar   = (char)_baseData.GetParamAsInt("LastChar");
            PdfArray widths     = _baseData.Values["Widths"] as PdfArray;
            char     actualChar = firstChar;

            foreach (IPdfElement elem in widths.Values)
            {
                double width = PdfElementUtils.GetReal(elem, 500);
                if (width < 0.0001f && width > -0.0001f)
                {
                    width = 500;
                }
                _widths.Add(actualChar, width / glyphSpaceToTextSpace);
                actualChar++;
            }
            // FIMXE: Calculate real height
        }