summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-09-22 11:16:04 -0700
committerRaph Levien <raph@google.com>2014-09-22 18:21:34 +0000
commitd5804e3937a961736e5cef0e8a70eacf91ee00bb (patch)
treef33a9530b7ac9b2a9c915a65d0a3844b5fb09b96
parent6740536e3927d25bf5c2567e5f6e8c175973cbb7 (diff)
downloadandroid_frameworks_minikin-d5804e3937a961736e5cef0e8a70eacf91ee00bb.tar.gz
android_frameworks_minikin-d5804e3937a961736e5cef0e8a70eacf91ee00bb.tar.bz2
android_frameworks_minikin-d5804e3937a961736e5cef0e8a70eacf91ee00bb.zip
Fine-tune fake-bolding conditionstaging/cm-12.0-caf
The old logic for fake bolding results in no fake bolding for a bold span on a light weight (300) because the target weight (600 in this case) didn't meet the condition. This patch fine-tunes the threshold to enable fake bolding for this. Bug: 17587185 Change-Id: I04abd00a74240cbed79c417f81486aa2158b2806
-rw-r--r--libs/minikin/FontFamily.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/minikin/FontFamily.cpp b/libs/minikin/FontFamily.cpp
index ab6ba20..f688a33 100644
--- a/libs/minikin/FontFamily.cpp
+++ b/libs/minikin/FontFamily.cpp
@@ -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);
}