forked from racket/racket
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix excessive correction of bounding
Commit 69984fb extended glyph bounding boxes in the wrong (pre-scaled) coordinate system.
- Loading branch information
Showing
1 changed file
with
12 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, |