[Wpf] Set TextRenderingHint when creating the drawing context
This commit is contained in:
Родитель
6fcad8484e
Коммит
60d361aac3
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче