Bug 4573. Was not dealing with the case where only a scalable font was

available (no bitmap fonts). Fixed.
This commit is contained in:
erik%netscape.com 1999-04-06 19:45:38 +00:00
Родитель 3028d55fda
Коммит b2c378b19c
1 изменённых файлов: 101 добавлений и 89 удалений

Просмотреть файл

@ -1310,12 +1310,16 @@ void
PickASizeAndLoad(nsFontSearch* aSearch, nsFontStretch* aStretch,
nsFontCharSet* aCharSet)
{
nsFontGTK* s;
nsFontGTK* begin = aStretch->mSizes;
nsFontGTK* end = &aStretch->mSizes[aStretch->mSizesCount];
nsFontGTK* s = nsnull;
nsFontGTK* begin;
nsFontGTK* end;
nsFontMetricsGTK* m = aSearch->mMetrics;
int desiredSize = m->mPixelSize;
int scalable = 0;
if (aStretch->mSizes) {
begin = aStretch->mSizes;
end = &aStretch->mSizes[aStretch->mSizesCount];
for (s = begin; s < end; s++) {
if (s->mSize >= desiredSize) {
break;
@ -1380,6 +1384,15 @@ PickASizeAndLoad(nsFontSearch* aSearch, nsFontStretch* aStretch,
if (aStretch->mScalable) {
double ratio = (s->mActualSize / ((double) desiredSize));
if ((ratio > 1.2) || (ratio < 0.8)) {
scalable = 1;
}
}
}
else {
scalable = 1;
}
if (scalable) {
begin = aStretch->mScaledFonts;
end = &aStretch->mScaledFonts[aStretch->mScaledFontsCount];
for (s = begin; s < end; s++) {
@ -1418,7 +1431,6 @@ PickASizeAndLoad(nsFontSearch* aSearch, nsFontStretch* aStretch,
}
}
}
}
if (m->mLoadedFontsCount == m->mLoadedFontsAlloc) {
int newSize;