Example #1
0
        public void DrawGlyphRuns(SharpDX.Direct2D1.WindowRenderTarget renderTarget, SharpDX.Direct2D1.Brush brush)
        {
            // Just iterate through all the saved glyph runs
            // and have DWrite to draw each one.

            for (int i = 0; i < glyphRuns_.Count; i++)
            {
                CustomGlyphRun customGlyphRun = glyphRuns_[i];
                if (customGlyphRun.glyphCount == 0)
                {
                    continue;
                }

                GlyphRun glyphRun = customGlyphRun.Convert(glyphIndices_, glyphAdvances_, glyphOffsets_);
                if (glyphRun != null)
                {
                    renderTarget.DrawGlyphRun(new Vector2(customGlyphRun.x, customGlyphRun.y), glyphRun, brush, MeasuringMode.Natural);
                }
            }
        }