iTextSharp.text.pdf.CFFFontSubset.CalcHints C# (CSharp) Метод

CalcHints() защищенный Метод

protected CalcHints ( int begin, int end, int LBias, int GBias, int LSubrsOffsets ) : int
begin int
end int
LBias int
GBias int
LSubrsOffsets int
Результат int
        protected int CalcHints(int begin,int end,int LBias,int GBias,int[] LSubrsOffsets)
        {
            // Goto begining of the subr
            Seek(begin);
            while (GetPosition() < end)
            {
                // Read the next command
                ReadCommand();
                int pos = GetPosition();
                Object TopElement = null;
                if (arg_count>0)
                    TopElement = args[arg_count-1];
                int NumOfArgs = arg_count;
                //Check the modification needed on the Argument Stack according to key;
                HandelStack();
                // a call to a Lsubr
                if (key=="callsubr")
                {
                    if (NumOfArgs>0)
                    {
                        int Subr = (int)TopElement + LBias;
                        CalcHints(LSubrsOffsets[Subr],LSubrsOffsets[Subr+1],LBias,GBias,LSubrsOffsets);
                        Seek(pos);
                    }
                }
                // a call to a Gsubr
                else if (key=="callgsubr")
                {
                    if (NumOfArgs>0)
                    {
                        int Subr = (int)TopElement + GBias;
                        CalcHints(gsubrOffsets[Subr],gsubrOffsets[Subr+1],LBias,GBias,LSubrsOffsets);
                        Seek(pos);
                    }
                }
                // A call to "stem"
                else if (key == "hstem" || key == "vstem" || key == "hstemhm" || key == "vstemhm")
                    // Increment the NumOfHints by the number couples of of arguments
                    NumOfHints += NumOfArgs/2;
                // A call to "mask"
                else if (key == "hintmask" || key == "cntrmask")
                {
                    // Compute the size of the mask
                    int SizeOfMask = NumOfHints/8;
                    if (NumOfHints%8 != 0 || SizeOfMask == 0)
                        SizeOfMask++;
                    // Continue the pointer in SizeOfMask steps
                    for (int i=0;i<SizeOfMask;i++)
                        GetCard8();
                }
            }
            return NumOfHints;
        }