I need to convert a GDI font to a WPF "Font".
myGdiFont As System.Drawing.Font
in
_Family As Windows.Media.FontFamily _Style As Windows.FontStyle _Weight As Windows.FontWeight _Size As Double
In particular, I need to convert
_Size = myGdiFont.Size (???)
WinForms font size is in units or dots ... In WPF it is in pixels ... How to convert from one to another?
PS.
Follwing Clementes testimony, is this right?
Dim myDrawingFont As New System.Drawing.Font("Arial", 10) Dim myWpfLabel As New Windows.Controls.Label myWpfLabel.FontSize = myDrawingFont.SizeInPoints * 72 / 96
Fixed
myWpfLabel.FontSize = myDrawingFont.SizeInPoints * 96 / 72
source share