зеркало из https://github.com/mozilla/gecko-dev.git
Bug 4573. Was not dealing with the case where only a scalable font was
available (no bitmap fonts). Fixed.
This commit is contained in:
Родитель
3028d55fda
Коммит
b2c378b19c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче