Esempio n. 1
0
 public override byte[] ConvertToBytes(GlyphLine glyphLine)
 {
     if (glyphLine != null)
     {
         byte[] bytes = new byte[glyphLine.Size()];
         int    ptr   = 0;
         if (fontEncoding.IsFontSpecific())
         {
             for (int i = 0; i < glyphLine.Size(); i++)
             {
                 bytes[ptr++] = (byte)glyphLine.Get(i).GetCode();
             }
         }
         else
         {
             for (int i = 0; i < glyphLine.Size(); i++)
             {
                 if (fontEncoding.CanEncode(glyphLine.Get(i).GetUnicode()))
                 {
                     bytes[ptr++] = (byte)fontEncoding.ConvertToByte(glyphLine.Get(i).GetUnicode());
                 }
             }
         }
         bytes = ArrayUtil.ShortenArray(bytes, ptr);
         foreach (byte b in bytes)
         {
             shortTag[b & 0xff] = 1;
         }
         return(bytes);
     }
     else
     {
         return(EMPTY_BYTES);
     }
 }