From 16dcc6f62a1706ebd55b0405b1174155b1ad999d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 15 Apr 2014 14:40:13 -0600 Subject: [PATCH] fix excessive correction of bounding Commit 69984fb231 extended glyph bounding boxes in the wrong (pre-scaled) coordinate system. --- .../native-libs/patches/cairo-coretext.patch | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/racket/src/native-libs/patches/cairo-coretext.patch b/racket/src/native-libs/patches/cairo-coretext.patch index 24fcf58ec8..e24047bc34 100644 --- a/racket/src/native-libs/patches/cairo-coretext.patch +++ b/racket/src/native-libs/patches/cairo-coretext.patch @@ -1,21 +1,14 @@ diff -r -u old/cairo-1.12.16/src/cairo-quartz-font.c new/cairo-1.12.16/src/cairo-quartz-font.c ---- old/cairo-1.12.16/src/cairo-quartz-font.c 2014-04-15 11:04:35.000000000 -0600 -+++ new/cairo-1.12.16/src/cairo-quartz-font.c 2014-04-15 11:05:43.000000000 -0600 -@@ -461,10 +461,12 @@ - bbox.size.width / emscale, bbox.size.height / emscale); - #endif +--- old/cairo-1.12.16/src/cairo-quartz-font.c 2014-04-15 13:39:14.000000000 -0600 ++++ new/cairo-1.12.16/src/cairo-quartz-font.c 2014-04-15 14:39:00.000000000 -0600 +@@ -440,7 +440,9 @@ + bbox.size.height / emscale); -- xmin = CGRectGetMinX(bbox); -- ymin = CGRectGetMinY(bbox); -- xmax = CGRectGetMaxX(bbox); -- ymax = CGRectGetMaxY(bbox); -+ /* add 1 to bounds to avoid round-off error that happens somewhere -+ in the path of rendering text (e.g., "-" vs. "-d" with 12-point Menlo) */ -+ xmin = CGRectGetMinX(bbox)-1; -+ ymin = CGRectGetMinY(bbox)-1; -+ xmax = CGRectGetMaxX(bbox)+1; -+ ymax = CGRectGetMaxY(bbox)+1; - - extents.x_bearing = xmin; - extents.y_bearing = - ymax; - + /* Should we want to always integer-align glyph extents, we can do so in this way */ +-#if 0 ++ /* Do so to avoid round-off error that happens somewhere in the path of rendering ++ text (e.g., "-" vs. "-d" with 12-point Menlo) */ ++#if 1 + { + CGAffineTransform textMatrix; + textMatrix = CGAffineTransformMake (font->base.scale.xx,