/hg/release/icedtea7-forest-2.4/jdk: Bug 1659: [IcedTea7] OpenJD...
yasuenag at icedtea.classpath.org
yasuenag at icedtea.classpath.org
Sun Feb 2 21:12:53 PST 2014
changeset e44a1aa00614 in /hg/release/icedtea7-forest-2.4/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4/jdk?cmd=changeset;node=e44a1aa00614
author: Yasumasa Suenaga <suenaga.yasumasa at lab.ntt.co.jp>
date: Mon Feb 03 14:10:39 2014 +0900
Bug 1659: [IcedTea7] OpenJDK 7 returns incorrect TrueType font metrics when bold style is set
Reviewed-by: Mario Torre <neugens at redhat.com> , KUBOTA Yuji <kubota.yuji at lab.ntt.co.jp>
Review-thread: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-January/026091.html
diffstat:
src/share/native/sun/font/freetypeScaler.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
diffs (61 lines):
diff -r 3bf3a83fe500 -r e44a1aa00614 src/share/native/sun/font/freetypeScaler.c
--- a/src/share/native/sun/font/freetypeScaler.c Wed Jan 29 10:01:29 2014 +0000
+++ b/src/share/native/sun/font/freetypeScaler.c Mon Feb 03 14:10:39 2014 +0900
@@ -441,7 +441,6 @@
jobject metrics;
jfloat ax, ay, dx, dy, bx, by, lx, ly, mx, my;
jfloat f0 = 0.0;
- FT_Pos bmodifier = 0;
FTScalerContext *context =
(FTScalerContext*) jlong_to_ptr(pScalerContext);
FTScalerInfo *scalerInfo =
@@ -474,30 +473,21 @@
So, we have to do adust them explicitly and stay consistent with what
freetype does to outlines. */
- /* For bolding glyphs are not just widened. Height is also changed
- (see ftsynth.c).
-
- TODO: In vertical direction we could do better job and adjust metrics
- proportionally to glyoh shape. */
- if (context->doBold) {
- bmodifier = FT_MulFix(
- scalerInfo->face->units_per_EM,
- scalerInfo->face->size->metrics.y_scale)/24;
- }
-
/**** Note: only some metrics are affected by styling ***/
#define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
+
+ /* See FreeType source code: src/base/ftobjs.c ft_recompute_scaled_metrics() */
/* ascent */
ax = 0;
ay = -(jfloat) (FT_MulFixFloatShift6(
- ((jlong) scalerInfo->face->ascender + bmodifier/2),
+ ((jlong) scalerInfo->face->ascender),
(jlong) scalerInfo->face->size->metrics.y_scale));
/* descent */
dx = 0;
dy = -(jfloat) (FT_MulFixFloatShift6(
- ((jlong) scalerInfo->face->descender + bmodifier/2),
+ ((jlong) scalerInfo->face->descender),
(jlong) scalerInfo->face->size->metrics.y_scale));
/* baseline */
bx = by = 0;
@@ -505,13 +495,12 @@
/* leading */
lx = 0;
ly = (jfloat) (FT_MulFixFloatShift6(
- (jlong) scalerInfo->face->height + bmodifier,
+ (jlong) scalerInfo->face->height,
(jlong) scalerInfo->face->size->metrics.y_scale))
+ ay - dy;
/* max advance */
mx = (jfloat) FT26Dot6ToFloat(
scalerInfo->face->size->metrics.max_advance +
- 2*bmodifier +
OBLIQUE_MODIFIER(scalerInfo->face->size->metrics.height));
my = 0;
More information about the distro-pkg-dev
mailing list