am 6cba4a1d: Fine-tune fake-bolding condition

* commit '6cba4a1dcae7ce1a359638405c3703b3cbb91277':
  Fine-tune fake-bolding condition
This commit is contained in:
Raph Levien 2014-09-23 16:17:41 +00:00 committed by Android Git Automerger
commit 5f94c59c2e

View File

@ -141,11 +141,11 @@ static int computeMatch(FontStyle style1, FontStyle style2) {
}
static FontFakery computeFakery(FontStyle wanted, FontStyle actual) {
// If desired weight is bold or darker, and 2 or more grades higher
// than actual (for example, medium 500 -> bold 700), then select
// fake bold.
// If desired weight is semibold or darker, and 2 or more grades
// higher than actual (for example, medium 500 -> bold 700), then
// select fake bold.
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();
return FontFakery(isFakeBold, isFakeItalic);
}