How to evaluate and change Windows font smoothing or ClearType during exports
Development licensing
Deployment licensing
ArcView
ArcView
ArcEditor
ArcEditor
ArcInfo
ArcInfo
Engine Developer Kit
Engine Runtime
Evaluating and changing font smoothing or ClearType during exports
To ensure quality output from ArcGIS image exporters, you can choose to disable the font smoothing option until the exports are complete.
Define the delegate function SystemParametersInfo from the Microsoft User32 application programming interface (API) along with some API constants in the declaration section. See the following code example:
PrivateDeclareAutoFunction SystemParametersInfo Lib"user32" (ByVal uiAction As UInteger, ByVal uiParam As UInteger, ByRef pvParam As UInteger, ByVal fWinIni As UInteger) AsBooleanPublicConst SPI_GETFONTSMOOTHING = 74
PublicConst SPI_SETFONTSMOOTHING = 75
PublicConst SPIF_UPDATEINIFILE = &H1
Define some functions to get the font smoothing value and to enable or disable it. See the following code example:
[C#]
private Boolean GetFontSmoothing()
{
bool iResult;
int pv = 0;
/* Call to systemparametersinfo to get the font smoothing value. */
iResult = SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, ref pv, 0);
if (pv > 0)
{
//pv > 0 means font smoothing is on.returntrue;
}
else
{
//pv == 0 means font smoothing is off.returnfalse;
}
}
privatevoid DisableFontSmoothing()
{
bool iResult;
int pv = 0;
/* Call to systemparametersinfo to set the font smoothing value. */
iResult = SystemParametersInfo(SPI_SETFONTSMOOTHING, 0, ref pv, SPIF_UPDATEINIFILE);
}
privatevoid EnableFontSmoothing()
{
bool iResult;
int pv = 0;
/* Call to systemparametersinfo to set the font smoothing value. */
iResult = SystemParametersInfo(SPI_SETFONTSMOOTHING, 1, ref pv, SPIF_UPDATEINIFILE);
}
[VB.NET]
Function GetFontSmoothing() AsBooleanDim iResults AsBooleanDim pv AsInteger'Get font smoothing value and return true if font smoothing is turned on.
iResults = SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, pv, 0)
If pv > 0 Then
GetFontSmoothing = TrueElse
GetFontSmoothing = FalseEndIfEndFunctionSub DisableFontSmoothing()
Dim iResults AsBooleanDim pv AsInteger'Call systemparametersinfo to turn font smoothing off.
iResults = SystemParametersInfo(SPI_SETFONTSMOOTHING, 0, pv, SPIF_UPDATEINIFILE)
EndSubSub EnableFontSmoothing()
Dim iResults AsBooleanDim pv AsInteger'Call systemparametersinfo to turn font smoothing on.
iResults = SystemParametersInfo(SPI_SETFONTSMOOTHING, 1, pv, SPIF_UPDATEINIFILE)
EndSub