am 6cba4a1d: Fine-tune fake-bolding condition
* commit '6cba4a1dcae7ce1a359638405c3703b3cbb91277': Fine-tune fake-bolding condition
This commit is contained in:
commit
5f94c59c2e
@ -141,11 +141,11 @@ static int computeMatch(FontStyle style1, FontStyle style2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FontFakery computeFakery(FontStyle wanted, FontStyle actual) {
|
static FontFakery computeFakery(FontStyle wanted, FontStyle actual) {
|
||||||
// If desired weight is bold or darker, and 2 or more grades higher
|
// If desired weight is semibold or darker, and 2 or more grades
|
||||||
// than actual (for example, medium 500 -> bold 700), then select
|
// higher than actual (for example, medium 500 -> bold 700), then
|
||||||
// fake bold.
|
// select fake bold.
|
||||||
int wantedWeight = wanted.getWeight();
|
int wantedWeight = wanted.getWeight();
|
||||||
bool isFakeBold = wantedWeight >= 7 && (wantedWeight - actual.getWeight()) >= 2;
|
bool isFakeBold = wantedWeight >= 6 && (wantedWeight - actual.getWeight()) >= 2;
|
||||||
bool isFakeItalic = wanted.getItalic() && !actual.getItalic();
|
bool isFakeItalic = wanted.getItalic() && !actual.getItalic();
|
||||||
return FontFakery(isFakeBold, isFakeItalic);
|
return FontFakery(isFakeBold, isFakeItalic);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user