Beispiel #1
0
        private ICidFont ParseDescendant(DictionaryToken dictionary, bool isLenientParsing)
        {
            var type = dictionary.GetNameOrDefault(NameToken.Type);
            if (type?.Equals(NameToken.Font) != true)
            {
                throw new InvalidFontFormatException($"Expected \'Font\' dictionary but found \'{type}\'");
            }

            var result = cidFontFactory.Generate(dictionary, isLenientParsing);

            return result;
        }
Beispiel #2
0
        private ICidFont ParseDescendant(PdfDictionary dictionary, IRandomAccessRead reader, bool isLenientParsing)
        {
            var type = dictionary.GetName(CosName.TYPE);

            if (!CosName.FONT.Equals(type))
            {
                throw new InvalidFontFormatException($"Expected \'Font\' dictionary but found \'{type.Name}\'");
            }

            var result = cidFontFactory.Generate(dictionary, reader, isLenientParsing);

            return(result);
        }