From d2ab687b4a859266ef6bf3ab94ed0ee4330c7741 Mon Sep 17 00:00:00 2001 From: RachamimYaakobov Date: Mon, 18 Sep 2017 21:51:18 +0300 Subject: [PATCH] Fix Text blurry Fix Text blurry --- Source/HtmlRenderer.WPF/Adapters/GraphicsAdapter.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/HtmlRenderer.WPF/Adapters/GraphicsAdapter.cs b/Source/HtmlRenderer.WPF/Adapters/GraphicsAdapter.cs index d61bef4ca..49649c320 100644 --- a/Source/HtmlRenderer.WPF/Adapters/GraphicsAdapter.cs +++ b/Source/HtmlRenderer.WPF/Adapters/GraphicsAdapter.cs @@ -200,8 +200,17 @@ public override void DrawString(string str, RFont font, RColor color, RPoint poi point.X += rtl ? 96d / 72d * font.Size * width : 0; glyphRendered = true; - var glyphRun = new GlyphRun(glyphTypeface, rtl ? 1 : 0, false, 96d / 72d * font.Size, glyphs, Utils.ConvertRound(point), widths, null, null, null, null, null, null); + var wpfPoint = Utils.ConvertRound(point); + var glyphRun = new GlyphRun(glyphTypeface, rtl ? 1 : 0, + false, 96d / 72d * font.Size, glyphs, + wpfPoint, widths, null, null, null, null, null, null); + + var guidelines = new GuidelineSet(); + guidelines.GuidelinesX.Add(wpfPoint.X); + guidelines.GuidelinesY.Add(wpfPoint.Y); + _g.PushGuidelineSet(guidelines); _g.DrawGlyphRun(colorConv, glyphRun); + _g.Pop(); } } @@ -318,4 +327,4 @@ public override void DrawPolygon(RBrush brush, RPoint[] points) #endregion } -} \ No newline at end of file +}