aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2012-07-26 15:50:40 -0700
committerVictoria Lease <violets@google.com>2012-07-26 15:52:24 -0700
commitd1280a29424e20a876a4995ff1446d57aac0289d (patch)
tree50e18099a6e5cf9562f535de599d9b0e8316db66
parentb4fad178c792687c50683880bcfaf507d54b30ca (diff)
downloadexternal_skia-d1280a29424e20a876a4995ff1446d57aac0289d.zip
external_skia-d1280a29424e20a876a4995ff1446d57aac0289d.tar.gz
external_skia-d1280a29424e20a876a4995ff1446d57aac0289d.tar.bz2
Reduce embolden effect.
Certain CJK glyphs become essentially unreadable when emboldened at sizes used by common apps like News/Weather. Reducing embolden strength slightly makes these glyphs much more readable without sacrificing bold/normal weight differentiation. Bug: 6712857 Change-Id: Iec1c478171e33751be1cddbaae6a8ec30bb6cbab
-rw-r--r--src/ports/SkFontHost_FreeType.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index da00d51..6aa2120 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -63,6 +63,16 @@
#define SK_GAMMA_EXPONENT 2.2
#endif
+// hand-tuned value to reduce outline embolden strength
+#ifndef SK_OUTLINE_EMBOLDEN_DIVISOR
+ #ifdef SK_BUILD_FOR_ANDROID
+ #define SK_OUTLINE_EMBOLDEN_DIVISOR 34
+ #else
+ #define SK_OUTLINE_EMBOLDEN_DIVISOR 24
+ #endif
+#endif
+
+
#ifdef SK_DEBUG
#define SkASSERT_CONTINUE(pred) \
do { \
@@ -892,7 +902,7 @@ FT_Error SkScalerContext_FreeType::setupSize() {
void SkScalerContext_FreeType::emboldenOutline(FT_Outline* outline) {
FT_Pos strength;
strength = FT_MulFix(fFace->units_per_EM, fFace->size->metrics.y_scale)
- / 24;
+ / SK_OUTLINE_EMBOLDEN_DIVISOR;
FT_Outline_Embolden(outline, strength);
}