mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
remove unused QtFontStyle members
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
b5a4956027
commit
08c8653411
2 changed files with 7 additions and 64 deletions
|
@ -189,18 +189,13 @@ struct QtFontStyle
|
|||
};
|
||||
|
||||
QtFontStyle(const Key &k)
|
||||
: key(k), bitmapScalable(false), smoothScalable(false),
|
||||
: key(k), smoothScalable(false),
|
||||
count(0), pixelSizes(0)
|
||||
{
|
||||
#if defined(Q_WS_X11)
|
||||
weightName = setwidthName = 0;
|
||||
#endif // Q_WS_X11
|
||||
}
|
||||
|
||||
~QtFontStyle() {
|
||||
#ifdef Q_WS_X11
|
||||
delete [] weightName;
|
||||
delete [] setwidthName;
|
||||
while (count) {
|
||||
// bitfield count-- in while condition does not work correctly in mwccsym2
|
||||
count--;
|
||||
|
@ -211,17 +206,11 @@ struct QtFontStyle
|
|||
}
|
||||
|
||||
Key key;
|
||||
bool bitmapScalable : 1;
|
||||
bool smoothScalable : 1;
|
||||
signed int count : 30;
|
||||
bool smoothScalable;
|
||||
int count;
|
||||
QtFontSize *pixelSizes;
|
||||
QString styleName;
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
const char *weightName;
|
||||
const char *setwidthName;
|
||||
#endif // Q_WS_X11
|
||||
|
||||
QtFontSize *pixelSize(unsigned short size, bool = false);
|
||||
};
|
||||
|
||||
|
@ -673,20 +662,11 @@ unsigned int bestFoundry(unsigned int score, int styleStrategy,
|
|||
}
|
||||
}
|
||||
|
||||
// 3. see if we have a bitmap scalable font
|
||||
if (!size && style->bitmapScalable && (styleStrategy & QFont::PreferMatch)) {
|
||||
size = style->pixelSize(0);
|
||||
if (size) {
|
||||
FM_DEBUG(" found bitmap scalable font (%d pixels)", pixelSize);
|
||||
px = pixelSize;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
QtFontEncoding *encoding = 0;
|
||||
#endif
|
||||
|
||||
// 4. find closest size match
|
||||
// 3. find closest size match
|
||||
if (! size) {
|
||||
unsigned int distance = ~0u;
|
||||
for (int x = 0; x < style->count; ++x) {
|
||||
|
@ -721,16 +701,8 @@ unsigned int bestFoundry(unsigned int score, int styleStrategy,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (style->bitmapScalable && ! (styleStrategy & QFont::PreferQuality) &&
|
||||
(distance * 10 / pixelSize) >= 2) {
|
||||
// the closest size is not close enough, go ahead and
|
||||
// use a bitmap scaled font
|
||||
size = style->pixelSize(0);
|
||||
px = pixelSize;
|
||||
} else {
|
||||
px = size->pixelSize;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
if (size) {
|
||||
|
@ -1083,30 +1055,6 @@ bool QFontDatabase::isFixedPitch(const QString &family,
|
|||
bool QFontDatabase::isBitmapScalable(const QString &family,
|
||||
const QString &style) const
|
||||
{
|
||||
QString familyName, foundryName;
|
||||
parseFontName(family, foundryName, familyName);
|
||||
|
||||
QMutexLocker locker(fontDatabaseMutex());
|
||||
|
||||
createDatabase();
|
||||
|
||||
QtFontStyle::Key styleKey(style);
|
||||
|
||||
QtFontFamily *f = d->family(familyName);
|
||||
if (!f) return false;
|
||||
|
||||
for (int j = 0; j < f->count; j++) {
|
||||
QtFontFoundry *foundry = f->foundries[j];
|
||||
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
|
||||
for (int k = 0; k < foundry->count; k++)
|
||||
if ((style.isEmpty() ||
|
||||
foundry->styles[k]->styleName == style ||
|
||||
foundry->styles[k]->key == styleKey)
|
||||
&& foundry->styles[k]->bitmapScalable && !foundry->styles[k]->smoothScalable) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -784,15 +784,10 @@ static void initializeFontDb()
|
|||
FD_DEBUG("\t\t'%s'", foundry->name.toLatin1().constData());
|
||||
for (int s = 0; s < foundry->count; s++) {
|
||||
QtFontStyle *style = foundry->styles[s];
|
||||
FD_DEBUG("\t\t\tstyle: style=%d weight=%d (%s)\n"
|
||||
"\t\t\tstretch=%d (%s)",
|
||||
style->key.style, style->key.weight,
|
||||
style->weightName, style->key.stretch,
|
||||
style->setwidthName ? style->setwidthName : "nil");
|
||||
FD_DEBUG("\t\t\tstyle: style=%d weight=%d stretch=%d",
|
||||
style->key.style, style->key.weight, style->key.stretch);
|
||||
if (style->smoothScalable)
|
||||
FD_DEBUG("\t\t\t\tsmooth scalable");
|
||||
else if (style->bitmapScalable)
|
||||
FD_DEBUG("\t\t\t\tbitmap scalable");
|
||||
if (style->pixelSizes) {
|
||||
qDebug("\t\t\t\t%d pixel sizes", style->count);
|
||||
for (int z = 0; z < style->count; ++z) {
|
||||
|
|
Loading…
Add table
Reference in a new issue