I found one answer and thought I'd post it in case someone searches for it in the future
There are two registry keys that control clear type for the current user:
HKEY_CURRENT_USER\Control Panel\Desktop\FontSmoothing
HKEY_CURRENT_USER\Control Panel\Desktop\FontSmoothingtype
There are Harbour functions to alter registry keys but I'm not experienced enough to use them at present
so using a powershell script <ctype.ps1> I can turn on cleartype with the following command lines
powershell set-executionpolicy remotesigned
The execution policy only needs to be run once on the platform
powershell -command "&ctype.ps1 1"
1 to turn on cleartype
<ctype.ps1> must be in the windows path or the full pathname specified
and then turn it off with
powershell -command "&c:\temp\ctype.ps1 0"
0 to turn off cleartype
The text for ctype.ps1 is:
#requires -version 2.0
param([bool]$enable)
$signature = @'
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$SPI_SETFONTSMOOTHING = 0x004B
$SPI_SETFONTSMOOTHINGTYPE = 0x200B
$SPIF_UPDATEINIFILE = 0x1
$SPIF_SENDCHANGE = 0x2
$FE_FONTSMOOTHINGCLEARTYPE = 0x2
$winapi = Add-Type -MemberDefinition $signature -Name WinAPI -PassThru
if ($enable)
{
[void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHING, 1, 0, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
[void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHINGTYPE, 0, $FE_FONTSMOOTHINGCLEARTYPE, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
}
else
{
[void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHING, 0, 0, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
}