コード例 #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 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);
            }
        }
コード例 #2
0
        /// <summary>
        /// Get a module's property value.
        /// </summary>
        /// <param name="moduleName">The module name.</param>
        /// <param name="propertyName">The property name. Properties are described in the ‘Synopsis’ subsection of the
        /// module's documentation.</param>
        /// <param name="value">A generic pointer to a variable or structure which gives the 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 PropertyGet(string moduleName, string propertyName, out IncreaseXHeightProperty value)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            IntPtr ptr;
            Error  err = FT.FT_Property_Get(Reference, moduleName, propertyName, out ptr);

            IncreaseXHeightPropertyRec ptrRec = PInvokeHelper.PtrToStructure <IncreaseXHeightPropertyRec>(ptr);
            Face face = childFaces.Find(f => f.Reference == ptrRec.face);

            value = new IncreaseXHeightProperty(ptrRec, face);
        }
コード例 #3
0
 internal IncreaseXHeightProperty(IncreaseXHeightPropertyRec rec, Face face)
 {
     this.rec  = rec;
     this.face = face;
 }
コード例 #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 void PropertySet(string moduleName, string propertyName, IncreaseXHeightProperty value)
        {
            IncreaseXHeightPropertyRec rec = value.Rec;

            PropertySet(moduleName, propertyName, ref rec);
        }