示例#1
0
        /// <summary>
        ///   This method creates a Frost cluster geometry from DirectWrite glyphs.
        /// </summary>
        /// <param name="key"> This parameter contains the cluster key information. </param>
        /// <param name="bidiLevel"> This parameter contains the bidi level for the cluster. </param>
        /// <param name="font"> This parameter references the font for the cluster. </param>
        /// <returns> This method returns the geometry for the cluster key. </returns>
        public Shape CreateGeometry(TextGeometryKey key, bool isVertical, bool isRightToLeft, FontHandle font)
        {
            Contract.Requires(font != null);

            FontFace face = font.ResolveFace();

            _GeometryBuilder = Shape.Create();

            Shape result;

            try
            {
                face.GetGlyphRunOutline(
                    1.0f, key.Indices, key.Advances, key.Offsets, isVertical, isRightToLeft, this);
            }
            finally
            {
                result = _GeometryBuilder.Build();
            }

            return result;
        }
示例#2
0
        /// <summary>
        ///   This method creates a Frost cluster geometry from DirectWrite glyphs.
        /// </summary>
        /// <param name="key"> This parameter contains the cluster key information. </param>
        /// <param name="bidiLevel"> This parameter contains the bidi level for the cluster. </param>
        /// <param name="font"> This parameter references the font for the cluster. </param>
        /// <returns> This method returns the geometry for the cluster key. </returns>
        public Geometry CreateGeometry(TextGeometryKey key, byte bidiLevel, FontHandle font)
        {
            Contract.Requires(font != null);

            FontFace face = font.ResolveFace();

            _GeometryBuilder = Geometry.Create();

            Geometry result;

            try
            {
                bool isRightToLeft = Convert.ToBoolean(bidiLevel & 1);

                face.GetGlyphRunOutline(
                    1.0f, key.Indices, key.Advances, key.Offsets, false, isRightToLeft, this);
            }
            finally
            {
                result = _GeometryBuilder.Build();
            }

            return result;
        }