Ejemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PatternBrushDescriptor(EpsInterpreter interpreter, Operand operand, Matrix matrix)
        {
            patternDict = (DictionaryOperand)operand;
            pattern     = PatternActivator.CreatePattern(interpreter, patternDict);

            this.matrix = matrix;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Prepare dictionaries
        /// </summary>
        private void PrepareStandardDictionaries(int postscriptVersion)
        {
            ResourceManager = new ResourceManager();
            ResourceManager.DefineResource("Category", new NameOperand("Generic"), new DictionaryOperand());

            DictionaryStack = new EpsStack <EpsDictionary>();
            SystemDict      = new EpsDictionary {
                IsPermanent = true
            };
            GlobalDict = new EpsDictionary {
                IsPermanent = true
            };
            UserDict = new EpsDictionary {
                IsPermanent = true
            };
            ErrorDict = new EpsDictionary {
                IsPermanent = true
            };
            DollarErrordict = new EpsDictionary {
                IsPermanent = true
            };
            statusDict = new EpsDictionary {
                IsPermanent = true
            };
            fontDict = new EpsDictionary {
                IsPermanent = true
            };

            DictionaryStack.Push(SystemDict);
            DictionaryStack.Push(GlobalDict);
            DictionaryStack.Push(UserDict);

            var systemDict = SystemDict;

            var     name    = new NameOperand("systemdict");
            Operand operand = new DictionaryOperand(SystemDict);

            systemDict.Add(name, operand);

            name    = new NameOperand("userdict");
            operand = new DictionaryOperand(UserDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("globaldict");
            operand = new DictionaryOperand(GlobalDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("statusdict");
            operand = new DictionaryOperand(statusDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("errordict");
            operand = new DictionaryOperand(ErrorDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("$error");
            operand = new DictionaryOperand(DollarErrordict);
            systemDict.Add(name, operand);

            name    = new NameOperand("GlobalFontDirectory");
            operand = new DictionaryOperand(fontDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("SharedFontDirectory");
            operand = new DictionaryOperand(fontDict);
            systemDict.Add(name, operand);

            name    = new NameOperand("true");
            operand = new BooleanOperand(true);
            systemDict.Add(name, operand);

            name    = new NameOperand("false");
            operand = new BooleanOperand(false);
            systemDict.Add(name, operand);

            name    = new NameOperand("null");
            operand = new NullOperand();
            systemDict.Add(name, operand);

            // for level 1 do not create this name, some adobe scripts
            // assume level 2 or higher just based on the existence of the name

            if (postscriptVersion >= 2)
            {
                name    = new NameOperand("languagelevel");
                operand = new IntegerOperand(postscriptVersion);
                systemDict.Add(name, operand);
            }

            name = new NameOperand("newerror");
            var b = new BooleanOperand(false);

            DollarErrordict.Add(name, b);
        }