bug 424165. clamp font weights from the OS to be within 100 and 900. r/a=vlad

This commit is contained in:
pavlov@pavlov.net 2008-03-21 21:16:00 -07:00
parent ea42d1a370
commit 2804ee6193

View File

@ -114,6 +114,9 @@ gfxWindowsPlatform::FontEnumProc(const ENUMLOGFONTEXW *lpelfe,
return 1;
}
// Some fonts claim to support things > 900, but we don't so clamp the sizes
logFont.lfWeight = PR_MAX(PR_MIN(logFont.lfWeight, 900), 100);
#ifdef DEBUG_pavlov
printf("%s %d %d %d\n", NS_ConvertUTF16toUTF8(nsDependentString(logFont.lfFaceName)).get(),
logFont.lfCharSet, logFont.lfItalic, logFont.lfWeight);