Hi Lance,
To determine if currently ClearType is enabled, you could use following
code:
Public Class Form1
Private Declare Function SystemParametersInfo Lib "user32" Alias
"SystemParametersInfoA" (ByVal uAction As Integer, _
ByVal uParam As Integer, ByRef lpvParam As Integer, _
ByVal fuWinIni As Integer) As Boolean
Private Const SPI_GETFONTSMOOTHINGTYPE As Integer = &H200A
Private Const FE_FONTSMOOTHINGCLEARTYPE As Integer = 2
Private Function IsClearTypeEnabled() As Boolean
Dim uiType As Integer = 0
Return SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, uiType, 0)
AndAlso uiType = FE_FONTSMOOTHINGCLEARTYPE
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
e.Graphics.DrawString("ClearType is " + IIf(IsClearTypeEnabled(),
"", "not ") + "enabled", Font, Brushes.Black, 0, 0)
MyBase.OnPaint(e)
End Sub
End Class
About your 2nd question, please refer to following documentation:
=========
#LOGFONT
http://msdn.microsoft.com/library/en-us/gdi/fontext_1wmq.asp?frame=true
Windows XP: The following situations do not support ClearType antialiasing:
* Text is rendered on a printer.
* Display set for 256 colors or less.
* Text is rendered to a terminal server client.
* The font is not a TrueType font or an OpenType font with TrueType
outlines. For example, the following do not support ClearType antialiasing:
Type 1 fonts, Postscript OpenType fonts without TrueType outlines, bitmap
fonts, vector fonts, and device fonts.
* The font has tuned embedded bitmaps, for any font sizes that contain the
embedded bitmaps. For example, this occurs commonly in East Asian fonts.
=========
Hope this helps. Let me know if you need further information. Thanks.
Sincerely,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.