예제 #1
0
        public unsafe uint SfntTableInfo(uint tableIndex, SfntTag tag)
        {
            uint length;
            Error err = FT.FT_Sfnt_Table_Info(Reference, tableIndex, &tag, out length);

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

            return length;
        }
예제 #2
0
        /// <summary>
        /// Return a pointer to a given SFNT table within a face.
        /// </summary>
        /// <remarks><para>
        /// The table is owned by the face object and disappears with it.
        /// </para><para>
        /// This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype
        /// drivers. See <see cref="SfntTag"/> for a list.
        /// </para></remarks>
        /// <param name="tag">The index of the SFNT table.</param>
        /// <returns><para>
        /// A type-less pointer to the table. This will be 0 in case of error, or if the corresponding table was not
        /// found OR loaded from the file.
        /// </para><para>
        /// Use a typecast according to ‘tag’ to access the structure elements.
        /// </para></returns>
        public object GetSfntTable(SfntTag tag)
        {
            IntPtr tableRef = FT.FT_Get_Sfnt_Table(Reference, tag);

            if (tableRef == IntPtr.Zero)
                return null;

            switch (tag)
            {
                case SfntTag.Header:
                    return new Header(tableRef);
                case SfntTag.HorizontalHeader:
                    return new HoriHeader(tableRef);
                case SfntTag.MaxProfile:
                    return new MaxProfile(tableRef);
                case SfntTag.OS2:
                    return new OS2(tableRef);
                case SfntTag.Pclt:
                    return new Pclt(tableRef);
                case SfntTag.Postscript:
                    return new Postscript(tableRef);
                case SfntTag.VertHeader:
                    return new VertHeader(tableRef);
                default:
                    return null;
            }
        }
예제 #3
0
 internal static unsafe extern Error FT_Sfnt_Table_Info(IntPtr face, uint table_index, SfntTag* tag, out uint length);
예제 #4
0
 internal static extern IntPtr FT_Get_Sfnt_Table(IntPtr face, SfntTag tag);
예제 #5
0
 internal static extern IntPtr FT_Get_Sfnt_Table(IntPtr face, SfntTag tag);