Exemplo n.º 1
0
 internal override void AddChar(String mark, CMapObject code)
 {
     if (code.IsNumber())
     {
         EncodeSequence(DecodeStringToByte(mark), (char)code.GetValue());
     }
 }
Exemplo n.º 2
0
 internal override void AddChar(String mark, CMapObject code)
 {
     if (code.IsNumber())
     {
         byte[] ser = DecodeStringToByte(mark);
         map.Put((int)code.GetValue(), ser);
     }
 }
Exemplo n.º 3
0
 internal override void AddChar(String mark, CMapObject code)
 {
     if (code.IsNumber())
     {
         int    codePoint;
         String s = ToUnicodeString(mark, true);
         if (iText.IO.Util.TextUtil.IsSurrogatePair(s, 0))
         {
             codePoint = iText.IO.Util.TextUtil.ConvertToUtf32(s, 0);
         }
         else
         {
             codePoint = (int)s[0];
         }
         map.Put(codePoint, (int)code.GetValue());
     }
 }
Exemplo n.º 4
0
        internal virtual void AddRange(String from, String to, CMapObject code)
        {
            byte[] a1 = DecodeStringToByte(from);
            byte[] a2 = DecodeStringToByte(to);
            if (a1.Length != a2.Length || a1.Length == 0)
            {
                throw new ArgumentException("Invalid map.");
            }
            byte[] sout = null;
            if (code.IsString())
            {
                sout = DecodeStringToByte(code.ToString());
            }
            int start = ByteArrayToInt(a1);
            int end   = ByteArrayToInt(a2);

            for (int k = start; k <= end; ++k)
            {
                IntToByteArray(k, a1);
                String mark = PdfEncodings.ConvertToString(a1, null);
                if (code.IsArray())
                {
                    IList <CMapObject> codes = (List <CMapObject>)code.GetValue();
                    AddChar(mark, codes[k - start]);
                }
                else
                {
                    if (code.IsNumber())
                    {
                        int nn = (int)code.GetValue() + k - start;
                        AddChar(mark, new CMapObject(CMapObject.NUMBER, nn));
                    }
                    else
                    {
                        if (code.IsString())
                        {
                            CMapObject s1 = new CMapObject(CMapObject.HEX_STRING, sout);
                            AddChar(mark, s1);
                            System.Diagnostics.Debug.Assert(sout != null);
                            IntToByteArray(ByteArrayToInt(sout) + 1, sout);
                        }
                    }
                }
            }
        }