Lines 789-794
Link Here
|
789 |
if (scalable) { |
789 |
if (scalable) { |
790 |
fontDef.stretch = request.stretch; |
790 |
fontDef.stretch = request.stretch; |
791 |
fontDef.style = request.style; |
791 |
fontDef.style = request.style; |
|
|
792 |
fontDef.weight = request.weight; |
792 |
} else { |
793 |
} else { |
793 |
int width; |
794 |
int width; |
794 |
if (FcPatternGetInteger(pattern, FC_WIDTH, 0, &width) == FcResultMatch) |
795 |
if (FcPatternGetInteger(pattern, FC_WIDTH, 0, &width) == FcResultMatch) |
Lines 1354-1359
Link Here
|
1354 |
// keep the same pitch |
1355 |
// keep the same pitch |
1355 |
equiv_enc->pitch = enc->pitch; |
1356 |
equiv_enc->pitch = enc->pitch; |
1356 |
} |
1357 |
} |
|
|
1358 |
|
1359 |
for (int k = 0; k < foundry->count; ++k) { |
1360 |
QtFontStyle *style = foundry->styles[k]; |
1361 |
if (style->key.weight > QFont::Normal) continue; |
1362 |
|
1363 |
QtFontSize *size = style->pixelSize(SMOOTH_SCALABLE); |
1364 |
if (! size) continue; // should not happen |
1365 |
QtFontEncoding *enc = size->encodingID(-1, 0, 0, 0, 0, true); |
1366 |
if (! enc) continue; // should not happen either |
1367 |
|
1368 |
QtFontStyle::Key key = style->key; |
1369 |
|
1370 |
// does this style have an demibold equivalent? |
1371 |
key.weight = QFont::DemiBold; |
1372 |
QtFontStyle *equiv = foundry->style(key); |
1373 |
if (equiv) continue; |
1374 |
|
1375 |
// does this style have an black equivalent? |
1376 |
key.weight = QFont::Black; |
1377 |
equiv = foundry->style(key); |
1378 |
if (equiv) continue; |
1379 |
|
1380 |
// does this style have an bold equivalent? |
1381 |
key.weight = QFont::Bold; |
1382 |
equiv = foundry->style(key); |
1383 |
if (equiv) continue; |
1384 |
|
1385 |
// let's fake one... |
1386 |
equiv = foundry->style(key, true); |
1387 |
equiv->smoothScalable = true; |
1388 |
|
1389 |
QtFontSize *equiv_size = equiv->pixelSize(SMOOTH_SCALABLE, true); |
1390 |
QtFontEncoding *equiv_enc = equiv_size->encodingID(-1, 0, 0, 0, 0, true); |
1391 |
|
1392 |
// keep the same pitch |
1393 |
equiv_enc->pitch = enc->pitch; |
1394 |
} |
1357 |
} |
1395 |
} |
1358 |
} |
1396 |
} |
1359 |
#endif |
1397 |
#endif |