예제 #1
0
 public CMapEncoding(String cmap, byte[] cmapBytes)
 {
     this.cmap = cmap;
     cid2Code  = new CMapCidByte();
     try {
         CMapParser.ParseCid(cmap, cid2Code, new CMapLocationFromBytes(cmapBytes));
         code2Cid             = cid2Code.GetReversMap();
         this.codeSpaceRanges = cid2Code.GetCodeSpaceRanges();
     }
     catch (System.IO.IOException) {
         LogManager.GetLogger(GetType()).Error(iText.IO.LogMessageConstant.FAILED_TO_PARSE_ENCODING_STREAM);
     }
 }
예제 #2
0
 /// <param name="cmap">CMap name.</param>
 /// <param name="uniMap">CMap to convert Unicode value to CID.</param>
 public CMapEncoding(String cmap, String uniMap)
 {
     this.cmap   = cmap;
     this.uniMap = uniMap;
     if (cmap.Equals(PdfEncodings.IDENTITY_H) || cmap.Equals(PdfEncodings.IDENTITY_V))
     {
         cid2Uni  = FontCache.GetCid2UniCmap(uniMap);
         isDirect = true;
     }
     else
     {
         cid2Code = FontCache.GetCid2Byte(cmap);
         code2Cid = cid2Code.GetReversMap();
     }
 }