Ejemplo n.º 1
0
        /// <summary>
        /// Convert a given glyph object to a bitmap glyph object.
        /// </summary>
        /// <remarks><para>
        /// This function does nothing if the glyph format isn't scalable.
        /// </para><para>
        /// The glyph image is translated with the ‘origin’ vector before rendering.
        /// </para><para>
        /// The first parameter is a pointer to an <see cref="Glyph"/> handle, that will be replaced by this function
        /// (with newly allocated data). Typically, you would use (omitting error handling):
        /// </para><para>
        /// --sample code ommitted--
        /// </para></remarks>
        /// <param name="renderMode">An enumeration that describes how the data is rendered.</param>
        /// <param name="origin">
        /// A pointer to a vector used to translate the glyph image before rendering. Can be 0 (if no translation). The
        /// origin is expressed in 26.6 pixels.
        /// </param>
        /// <param name="destroy">
        /// A boolean that indicates that the original glyph image should be destroyed by this function. It is never
        /// destroyed in case of error.
        /// </param>
        public Glyph ToBitmap(RenderMode renderMode, FTVector26Dot6 origin, bool destroy)
        {
            IntPtr glyphRef = Reference;
            Error  err      = FT.FT_Glyph_To_Bitmap(ref glyphRef, renderMode, ref origin, destroy);

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

            return(new Glyph(glyphRef, Library));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Convert a given glyph object to a bitmap glyph object.
        /// </summary>
        /// <remarks><para>
        /// This function does nothing if the glyph format isn't scalable.
        /// </para><para>
        /// The glyph image is translated with the ‘origin’ vector before rendering.
        /// </para><para>
        /// The first parameter is a pointer to an <see cref="Glyph"/> handle, that will be replaced by this function
        /// (with newly allocated data). Typically, you would use (omitting error handling):
        /// </para><para>
        /// --sample code ommitted--
        /// </para></remarks>
        /// <param name="renderMode">An enumeration that describes how the data is rendered.</param>
        /// <param name="origin">
        /// A pointer to a vector used to translate the glyph image before rendering. Can be 0 (if no translation). The
        /// origin is expressed in 26.6 pixels.
        /// </param>
        /// <param name="destroy">
        /// A boolean that indicates that the original glyph image should be destroyed by this function. It is never
        /// destroyed in case of error.
        /// </param>
        public void ToBitmap(RenderMode renderMode, FTVector26Dot6 origin, bool destroy)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Glyph", "Cannot access a disposed object.");
            }

            IntPtr glyphRef = Reference;
            Error  err      = FT.FT_Glyph_To_Bitmap(ref glyphRef, renderMode, ref origin, destroy);

            Reference = glyphRef;

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }
        }
Ejemplo n.º 3
0
 internal static extern Error FT_Glyph_To_Bitmap(ref IntPtr the_glyph, RenderMode render_mode, ref FTVector26Dot6 origin, [MarshalAs(UnmanagedType.U1)] bool destroy);
Ejemplo n.º 4
0
 internal static extern Error FT_Get_Kerning(IntPtr face, uint left_glyph, uint right_glyph, uint kern_mode, out FTVector26Dot6 akerning);