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

private FT_Property_Set ( IntPtr library, string module_name, string property_name, IntPtr value ) : System.Error
library System.IntPtr
module_name string
property_name string
value System.IntPtr
Результат System.Error
Пример #1
0
        /// <summary>
        /// Set a property for a given module.
        /// </summary>
        /// <param name="moduleName">The module name.</param>
        /// <param name="propertyName"><para>The property name. Properties are described in the ‘Synopsis’ subsection
        /// of the module's documentation.
        /// </para><para>
        /// Note that only a few modules have properties.</para></param>
        /// <param name="value">A generic pointer to a variable or structure which gives the new value of the property.
        /// The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's
        /// documentation.</param>
        public void PropertySet(string moduleName, string propertyName, IntPtr value)
        {
            Error err = FT.FT_Property_Set(Reference, moduleName, propertyName, value);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }
        }
Пример #2
0
        /// <summary>
        /// Set a property for a given module.
        /// </summary>
        /// <param name="moduleName">The module name.</param>
        /// <param name="propertyName"><para>The property name. Properties are described in the ‘Synopsis’ subsection
        /// of the module's documentation.
        /// </para><para>
        /// Note that only a few modules have properties.</para></param>
        /// <param name="value">A generic pointer to a variable or structure which gives the new value of the property.
        /// The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's
        /// documentation.</param>
        public void PropertySet(string moduleName, string propertyName, IntPtr value)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            Error err = FT.FT_Property_Set(Reference, moduleName, propertyName, value);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }
        }
Пример #3
0
        /// <summary>
        /// Set a property for a given module.
        /// </summary>
        /// <typeparam name="T">The type of property to set.</typeparam>
        /// <param name="moduleName">The module name.</param>
        /// <param name="propertyName"><para>The property name. Properties are described in the ‘Synopsis’ subsection
        /// of the module's documentation.
        /// </para><para>
        /// Note that only a few modules have properties.</para></param>
        /// <param name="value">A generic pointer to a variable or structure which gives the new value of the property.
        /// The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's
        /// documentation.</param>
        public unsafe void PropertySet <T>(string moduleName, string propertyName, T value)
            where T : struct
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            IntPtr ptr = IntPtr.Zero;

            Marshal.StructureToPtr((object)value, ptr, false);             //Should that last value be false? Any other way to get a pointer?

            Error err = FT.FT_Property_Set(Reference, moduleName, propertyName, ptr);
        }
Пример #4
0
        /// <summary>
        /// Set a property for a given module.
        /// </summary>
        /// <param name="moduleName">The module name.</param>
        /// <param name="propertyName"><para>The property name. Properties are described in the ‘Synopsis’ subsection
        /// of the module's documentation.
        /// </para><para>
        /// Note that only a few modules have properties.</para></param>
        /// <param name="value">A generic pointer to a variable or structure which gives the new value of the property.
        /// The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's
        /// documentation.</param>
        public unsafe void PropertySet(string moduleName, string propertyName, IncreaseXHeightProperty value)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            IncreaseXHeightPropertyRec rec = value.Rec;
            Error err = FT.FT_Property_Set(Reference, moduleName, propertyName, (IntPtr)(&rec));

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