Example #1
0
 internal static byte[] ReadFontBytesFromWpf(WpfGlyphTypeface wpfGlyphTypeface)
 {
     using (Stream fontStream = wpfGlyphTypeface.GetFontStream())
     {
         if (fontStream == null)
         {
             throw new InvalidOperationException("Cannot retrieve font data.");
         }
         int    size  = (int)fontStream.Length;
         byte[] bytes = new byte[size];
         fontStream.Read(bytes, 0, size);
         return(bytes);
     }
 }
Example #2
0
 /// <summary>
 /// Возвращает поток файла шрифта.
 /// </summary>
 /// <returns></returns>
 public Stream GetFontStream()
 {
     return(_glyphTypeface.GetFontStream());
 }
Example #3
0
 internal static byte[] ReadFontBytesFromWpf(WpfGlyphTypeface wpfGlyphTypeface)
 {
     using (Stream fontStream = wpfGlyphTypeface.GetFontStream())
     {
         if (fontStream == null)
             throw new InvalidOperationException("Cannot retrieve font data.");
         int size = (int)fontStream.Length;
         byte[] bytes = new byte[size];
         fontStream.Read(bytes, 0, size);
         return bytes;
     }
 }