/// <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); }
/// <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); }
private void RegenerateFontPath(RenderContext context) { var text = Text; if (text == null) { return; } _fontPath = new D2DFontPathData(text, context, _font, _fontFace); }
public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, PointF offset) { context.DrawPath(pen, path, offset, true); }
public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, PointF offset, bool yCorrection) { context.DrawPath(pen, path, offset.X, offset.Y, yCorrection); }
public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path) { path.Fill(context, brush); }
public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path, float offsetX, float offsetY) { context.DrawPath(pen, path, offsetX, offsetY, true); }
public static void DrawPath(this RenderContext context, ID2DPen pen, D2DFontPathData path) { path.Draw(context, pen); }
public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, PointF offset) { context.FillPath(brush, path, offset, true); }
public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, PointF offset, bool yCorrection) { context.FillPath(brush, path, offset.X, offset.Y, yCorrection); }
public static void FillPath(this RenderContext context, ID2DBrush brush, D2DFontPathData path, float offsetX, float offsetY) { context.FillPath(brush, path, offsetX, offsetY, true); }