Beispiel #1
0
 /// <summary>
 /// Draws a <see cref="D2DFontPathData"/> to current <see cref="RenderContext"/>.
 /// </summary>
 /// <param name="context">The <see cref="RenderContext"/> to draw to.</param>
 /// <param name="pen">The <see cref="D2DPen"/> to use.</param>
 /// <param name="path">The <see cref="D2DFontPathData"/> to draw.</param>
 /// <param name="offsetX">The X offset on target <see cref="RenderContext"/>.</param>
 /// <param name="offsetY">The Y offset on target <see cref="RenderContext"/>.</param>
 /// <param name="yCorrection">If <see langword="true"/>, apply automatic Y correction: y(real) = offsetY + lineHeight. If <see langword="false"/>, the Y value stays untouched.</param>
 public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, float offsetX, float offsetY, bool yCorrection)
 {
     if (yCorrection)
     {
         offsetY += path.LineHeight;
     }
     path.Draw(context, pen, offsetX, offsetY);
 }
Beispiel #2
0
 /// <summary>
 /// Fills a <see cref="D2DFontPathData"/> to current <see cref="RenderContext"/>.
 /// </summary>
 /// <param name="context">The <see cref="RenderContext"/> to fill to.</param>
 /// <param name="brush">The <see cref="D2DBrushBase"/> to use.</param>
 /// <param name="path">The <see cref="D2DFontPathData"/> to fill.</param>
 /// <param name="offsetX">The X offset on target <see cref="RenderContext"/>.</param>
 /// <param name="offsetY">The Y offset on target <see cref="RenderContext"/>.</param>
 /// <param name="yCorrection">If <see langword="true"/>, apply automatic Y correction: y(real) = offsetY + lineHeight. If <see langword="false"/>, the Y value stays untouched.</param>
 public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, float offsetX, float offsetY, bool yCorrection)
 {
     if (yCorrection)
     {
         offsetY += path.LineHeight;
     }
     path.Fill(context, brush, offsetX, offsetY);
 }
Beispiel #3
0
        private void RegenerateFontPath(RenderContext context)
        {
            var text = Text;

            if (text == null)
            {
                return;
            }
            _fontPath = new D2DFontPathData(text, context, _font, _fontFace);
        }
Beispiel #4
0
 public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, PointF offset)
 {
     context.DrawPath(pen, path, offset, true);
 }
Beispiel #5
0
 public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, PointF offset, bool yCorrection)
 {
     context.DrawPath(pen, path, offset.X, offset.Y, yCorrection);
 }
Beispiel #6
0
 public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path)
 {
     path.Fill(context, brush);
 }
Beispiel #7
0
 public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, float offsetX, float offsetY)
 {
     context.DrawPath(pen, path, offsetX, offsetY, true);
 }
Beispiel #8
0
 public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path)
 {
     path.Draw(context, pen);
 }
Beispiel #9
0
 public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, PointF offset)
 {
     context.FillPath(brush, path, offset, true);
 }
Beispiel #10
0
 public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, PointF offset, bool yCorrection)
 {
     context.FillPath(brush, path, offset.X, offset.Y, yCorrection);
 }
Beispiel #11
0
 public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, float offsetX, float offsetY)
 {
     context.FillPath(brush, path, offsetX, offsetY, true);
 }