How to make font render smoothly in firefox just like safari and IE7
How to evaluate and change Windows font smoothing or ClearType
(although I'm sure this is condemned as browser hijack)
[DllImport("user32.dll", SetLastError = true)]
static extern bool
SystemParametersInfo(uint uiAction, uint uiParam,
ref int pvParam, uint fWinIni);
/* Constants used for User32 calls. */
const uint SPI_GETFONTSMOOTHING = 74;
const uint SPI_SETFONTSMOOTHING = 75;
const unit SPI_UPDATEINI = 0x1;
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.
return true;
}
else
{
//pv == 0 means font smoothing is off.
return false;
}
}
private void DisableFontSmoothing()
{
bool iResult;
int pv = 0;
/* Call to systemparametersinfo
to set the font smoothing value. */
iResult =
SystemParametersInfo(SPI_SETFONTSMOOTHING, 0,
ref pv, SPIF_UPDATEINIFILE);
}
private void EnableFontSmoothing()
{
bool iResult;
int pv = 0;
/* Call to systemparametersinfo
to set the font smoothing value. */
iResult =
SystemParametersInfo(SPI_SETFONTSMOOTHING, 1,
ref pv, SPIF_UPDATEINIFILE);
}
More on ClearType:
Microsoft Typography
Microsoft ClearType FAQ
Technical Overview of ClearType Filtering
No comments:
Post a Comment