[Wpf] Set TextRenderingHint when creating the drawing context

This commit is contained in:
Jeremie Laval 2012-11-06 12:04:26 +00:00
Родитель 6fcad8484e
Коммит 60d361aac3
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -285,7 +285,6 @@ namespace Xwt.WPFBackend
stringFormat.Trimming = trimming;
}
c.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
c.Graphics.DrawString (layout.Text, layout.Font.ToDrawingFont (), c.Brush,
new RectangleF ((float)x, (float)y, (float)measure.Width, h),
stringFormat);

Просмотреть файл

@ -43,8 +43,10 @@ namespace Xwt.WPFBackend
graphics.CompositingQuality = CompositingQuality.HighSpeed;
// necessary for correct text rendering with System.Drawing
graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
//graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
// necessary for none-pixelated text drawing in images, revert to above line if it introduces a performance problem
graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
Graphics = graphics;
}