"not_a_commie" <no********@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
>I want to take the FontSize from a System.drawing.Font type and turn
that into a System.Windows.Controls FontSize. (Actually, I'd like to
take the whole font over, but I didn't see any standard converter.)
The former is a float and the latter a double. In XAML, though, you
can specify a string to handle the conversion. I understand I can do
this: NewFontSize = MainOldFont.Size * 96/72; however, isn't that 96
dependent upon a user setting? Do I have access to that setting
somehow? Thanks.
No.
See:
About Resolution and Device-Independent Graphics
There are two system factors that determine the size of text and graphics on
your screen: resolution and DPI. Resolution describes the number of pixels
that appear on the screen. As the resolution gets higher, pixels get
smaller, causing graphics and text to appear smaller. A graphic displayed on
a monitor set to 1024 x 768 will appear much smaller when the resolution is
changed to 1600 x 1200.
The other system setting, DPI, describes the size of a screen inch in
pixels. Most Windows systems have a DPI of 96, which means a screen inch is
96 pixels. Increasing the DPI setting makes the screen inch larger;
decreasing the DPI makes the screen inch smaller. This means that a screen
inch isn't the same size as a real-world inch; on most systems, it's
probably not. As you increase the DPI, DPI-aware graphics and text become
larger because you've increased the size of the screen inch. Increasing the
DPI can make text easier to read, especially at high resolutions.
Not all applications are DPI-aware: some use hardware pixels as the primary
unit of measurement; changing the system DPI has no effect on these
applications. Many other applications use DPI-aware units to describe font
sizes, but use pixels to describe everything else. Making the DPI too small
or too large can cause layout problems for these applications, because the
applications' text scales with the system's DPI setting, but the
applications' UI does not. This problem has been eliminated for applications
developed using WPF.
WPF supports automatic scaling by using the device independent pixel as its
primary unit of measurement, instead of hardware pixels; graphics and text
scale properly without any extra work from the application developer. The
following illustration shows an example of how WPF text and graphics are
appear at different DPI settings.
http://msdn2.microsoft.com/en-us/library/ms748373.aspx