 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
firace
Joined: 08 Feb 2009 Posts: 28
|
Posted: Sat Feb 21, 2009 4:13 am Post subject: force font antialiasing |
|
|
Is it possible to force a text control to be antialiased or not (regardless
of the global preference set in the windows control panel) ?
I know for a fact that this kind of application specific setting is supported by Windows. But don't know how to achieve it in AHK.
I couldn't find anything about this in the help file. Perhaps through a windows gdi funcition call or something?
Any ideas?
thanks!
Last edited by firace on Wed Feb 25, 2009 4:28 pm; edited 1 time in total |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Sat Feb 21, 2009 5:21 am Post subject: Re: script-specific font antialiasing (or not) |
|
|
| lazygeek wrote: | | I know for a fact that this kind of application specific setting is supported by Windows. | If you know it is supported, why ask if it is possible?
In actual fact, there is no application-specific setting. However, it can be controlled per-font via the fdwQuality parameter of CreateFont when the font is created. |
|
| Back to top |
|
 |
firace
Joined: 08 Feb 2009 Posts: 28
|
Posted: Wed Feb 25, 2009 4:26 pm Post subject: |
|
|
Hi, thanks but I think I need some more help with this.
Not too familiar with dll calls from ahk...
Let's take the below code, for example.
What would be the simplest way to force the text to be antialiased (regardless of the Windows preferences)?
| Code: |
gui, font, s14 bold, Courier
gui, add, text,, hello world!
gui, show
|
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Wed Feb 25, 2009 5:03 pm Post subject: |
|
|
| Code: | Gui, Add, Text, w450 h60 hwndText1 0x201, Anti-Aliased
Gui, Add, Text, w450 h60 hwndText2 0x201, Non Anti-Aliased
nHeight := 50
fnWeight := 700 ; FW_BOLD
fdwCharSet := 0x1 ; DEFAULT_CHARSET
lpszFace := "Courier New"
ANTIALIASED_QUALITY := 0x4
NONANTIALIASED_QUALITY := 0x3
hFont1 := DllCall( "CreateFont", Int,nHeight, Int,0, Int,0, Int,0, UInt,fnWeight, Int,0
,Int,0, Int,0, UInt,fdwCharSet, Int,0, Int,0, Int,ANTIALIASED_QUALITY, Int,0, Str,lpszFace )
hFont2 := DllCall( "CreateFont", Int,nHeight, Int,0, Int,0, Int,0, UInt,fnWeight, Int,0
,Int,0, Int,0, UInt,fdwCharSet, Int,0, Int,0, Int,NONANTIALIASED_QUALITY, Int,0, Str,lpszFace )
SendMessage, 0x30, hFont1, 1,, ahk_id %Text1%
SendMessage, 0x30, hFont2, 1,, ahk_id %Text2%
Gui, Show,, Anti-Alias Demo |
|
|
| Back to top |
|
 |
firace
Joined: 08 Feb 2009 Posts: 28
|
Posted: Wed Feb 25, 2009 5:24 pm Post subject: |
|
|
| Whoa! Fantastic. Thanks so much, SKAN. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|