Пример #1
0
        /// <summary>
        /// Initialize a FreeTypeFaceFacade instance with font data.
        /// </summary>
        public FreeTypeFaceFacade(FreeTypeLibrary library, IntPtr fontData, int dataLength, int faceIndex = 0)
        {
            _Library = library;

            var err = FT.FT_New_Memory_Face(_Library.Native, fontData, dataLength, faceIndex, out _Face);

            if (err != FT_Error.FT_Err_Ok)
            {
                throw new FreeTypeException(err);
            }

            _FaceRec = (FT_FaceRec *)_Face;
        }
Пример #2
0
 /// <summary>
 /// Initialize a FreeTypeFaceFacade instance with a pointer to the Face instance.
 /// </summary>
 public FreeTypeFaceFacade(FreeTypeLibrary library, IntPtr face)
 {
     _Library = library;
     _Face    = face;
     _FaceRec = (FT_FaceRec *)_Face;
 }