FT_New_Face_From_FSRef() приватный Метод

private FT_New_Face_From_FSRef ( IntPtr library, IntPtr @ref, int face_index, IntPtr &aface ) : System.Error
library System.IntPtr
@ref System.IntPtr
face_index int
aface System.IntPtr
Результат System.Error
Пример #1
0
        /// <summary>
        /// Create a new face object from a given resource and typeface index using an FSRef to the font file.
        /// </summary>
        /// <remarks>
        /// <see cref="NewFaceFromFSRef"/> is identical to <see cref="NewFace"/> except it accepts an FSRef instead of
        /// a path.
        /// </remarks>
        /// <param name="ref">FSRef to the font file.</param>
        /// <param name="faceIndex">The index of the face within the resource. The first face has index 0.</param>
        /// <returns>A handle to a new face object.</returns>
        public Face NewFaceFromFSRef(IntPtr @ref, int faceIndex)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            IntPtr faceRef;

            Error err = FT.FT_New_Face_From_FSRef(Reference, @ref, faceIndex, out faceRef);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            return(new Face(faceRef, this));
        }
Пример #2
0
        /// <summary>
        /// Create a new face object from a given resource and typeface index using an FSRef to the font file.
        /// </summary>
        /// <remarks>
        /// <see cref="NewFaceFromFSRef"/> is identical to <see cref="NewFace"/> except it accepts an FSRef instead of
        /// a path.
        /// </remarks>
        /// <param name="ref">FSRef to the font file.</param>
        /// <param name="faceIndex">The index of the face within the resource. The first face has index 0.</param>
        /// <returns>A handle to a new face object.</returns>
        public Face NewFaceFromFSRef(IntPtr @ref, int faceIndex)
        {
            if (!FT.IsMacOS)
            {
                throw new InvalidOperationException(
                          $"{nameof(NewFaceFromFSRef)} can only be called on macOS.");
            }

            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            IntPtr faceRef;

            Error err = FT.FT_New_Face_From_FSRef(Reference, @ref, faceIndex, out faceRef);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            return(new Face(faceRef, this));
        }