Example #1
0
 internal GlyphSlot(IntPtr reference, Face parentFace, Library parentLibrary)
 {
     this.reference     = reference;
     rec                = PInvokeHelper.PtrToStructure <GlyphSlotRec>(reference);
     this.parentFace    = parentFace;
     this.parentLibrary = parentLibrary;
 }
Example #2
0
        /// <summary>
        /// Get a module's property value.
        /// </summary>
        /// <typeparam name="T">The type of property to get.</typeparam>
        /// <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">The value read from the module.</param>
        public void PropertyGet <T>(string moduleName, string propertyName, out T value)
            where T : struct
        {
            value = default(T);

            GCHandle gch = GCHandle.Alloc(value, GCHandleType.Pinned);

            PropertyGet(moduleName, propertyName, gch.AddrOfPinnedObject());
            value = PInvokeHelper.PtrToStructure <T>(gch.AddrOfPinnedObject());
            gch.Free();
        }
Example #3
0
        internal FTSize(IntPtr reference, Face parentFace)
        {
            this.reference = reference;
            rec            = PInvokeHelper.PtrToStructure <SizeRec>(reference);


            if (parentFace != null)
            {
                this.parentFace = parentFace;
            }
        }
Example #4
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);
        }
Example #5
0
        /// <summary>
        /// Get a module's property value.
        /// </summary>
        /// <typeparam name="T">The type of property to get.</typeparam>
        /// <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 <T>(string moduleName, string propertyName, out T 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);

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

            value = PInvokeHelper.PtrToStructure <T>(ptr);
        }
Example #6
0
 internal Generic(IntPtr reference)
 {
     rec = PInvokeHelper.PtrToStructure <GenericRec>(reference);
 }
Example #7
0
 internal GlyphMetrics(IntPtr reference)
 {
     this.reference = reference;
     rec            = PInvokeHelper.PtrToStructure <GlyphMetricsRec>(reference);
 }
Example #8
0
 internal FTBitmap(IntPtr reference, Library library)
 {
     this.reference = reference;
     rec            = PInvokeHelper.PtrToStructure <BitmapRec>(reference);
 }