The font-smoothing routines may be useful even if you don't want to do it from the command line.
You use the program as follows:
Code: Select all
fs on/off c/s contrast
Examples
--------
Turn font smoothing on, set it to ClearType, and set the contrast to 1000:
fs on c 1000
Turn font smoothing on, set it to Standard:
fs on s
Turn font smoothing off:
fs off
Code: Select all
Procedure FontSmoothingOFF()
; turn fontsmoothing off
SystemParametersInfo_(#SPI_SETFONTSMOOTHING, #False, 0, #SPIF_SENDWININICHANGE | #SPIF_UPDATEINIFILE)
RedrawWindow_(0, 0, 0, #RDW_ERASE | #RDW_FRAME | #RDW_ALLCHILDREN | #RDW_INTERNALPAINT | #RDW_INVALIDATE | #RDW_ERASENOW | #RDW_UPDATENOW);
EndProcedure
Procedure FontSmoothingON(FSType.l, Contrast.l = -1)
; turn fontsmoothing on
SystemParametersInfo_(#SPI_SETFONTSMOOTHING, #True, 0, #SPIF_SENDWININICHANGE | #SPIF_UPDATEINIFILE)
; set font smoothing type
SystemParametersInfo_(#SPI_SETFONTSMOOTHINGTYPE, 0, FSType, #SPIF_SENDWININICHANGE | #SPIF_UPDATEINIFILE)
; set font smoothing contrast
If FSType = #FE_FONTSMOOTHINGCLEARTYPE And Contrast <> -1
If Contrast < 1000
Contrast = 1000
ElseIf Contrast > 2200
Contrast = 2200
EndIf
SystemParametersInfo_(#SPI_SETFONTSMOOTHINGCONTRAST, 0, Contrast, #SPIF_SENDWININICHANGE | #SPIF_UPDATEINIFILE)
EndIf
RedrawWindow_(0, 0, 0, #RDW_ERASE | #RDW_FRAME | #RDW_ALLCHILDREN | #RDW_INTERNALPAINT | #RDW_INVALIDATE | #RDW_ERASENOW | #RDW_UPDATENOW);
EndProcedure
pOnOff.s = UCase(ProgramParameter())
pFSType.s = UCase(ProgramParameter())
pContrast.s = ProgramParameter()
If pOnOff = "ON"
If pFSType = "C"
If pContrast
FontSmoothingON(#FE_FONTSMOOTHINGCLEARTYPE, Val(pContrast))
Else
FontSmoothingON(#FE_FONTSMOOTHINGCLEARTYPE)
EndIf
ElseIf pFSType = "S"
FontSmoothingON(#FE_FONTSMOOTHINGSTANDARD)
EndIf
ElseIf pOnOff = "OFF"
FontSmoothingOFF()
EndIf
Eric