summaryrefslogtreecommitdiffstats
path: root/gfx/cairo/win32-cleartype-clipping.patch
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /gfx/cairo/win32-cleartype-clipping.patch
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/cairo/win32-cleartype-clipping.patch')
-rw-r--r--gfx/cairo/win32-cleartype-clipping.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/gfx/cairo/win32-cleartype-clipping.patch b/gfx/cairo/win32-cleartype-clipping.patch
new file mode 100644
index 000000000..839e94039
--- /dev/null
+++ b/gfx/cairo/win32-cleartype-clipping.patch
@@ -0,0 +1,23 @@
+diff --git a/gfx/cairo/cairo/src/cairo-win32-font.c b/gfx/cairo/cairo/src/cairo-win32-font.c
+--- a/gfx/cairo/cairo/src/cairo-win32-font.c
++++ b/gfx/cairo/cairo/src/cairo-win32-font.c
+@@ -986,6 +986,19 @@ _cairo_win32_scaled_font_init_glyph_metr
+ &metrics, 0, NULL, &matrix) == GDI_ERROR) {
+ status = _cairo_win32_print_gdi_error ("_cairo_win32_scaled_font_init_glyph_metrics:GetGlyphOutlineW");
+ memset (&metrics, 0, sizeof (GLYPHMETRICS));
++ } else {
++ if (metrics.gmBlackBoxX > 0 && scaled_font->base.options.antialias != CAIRO_ANTIALIAS_NONE) {
++ /* The bounding box reported by Windows supposedly contains the glyph's "black" area;
++ * however, antialiasing (especially with ClearType) means that the actual image that
++ * needs to be rendered may "bleed" into the adjacent pixels, mainly on the right side.
++ * To avoid clipping the glyphs when drawn by _cairo_surface_fallback_show_glyphs,
++ * for example, or other code that uses glyph extents to determine the area to update,
++ * we add a pixel of "slop" to left side of the nominal "black" area returned by GDI,
++ * and two pixels to the right (as tests show some glyphs bleed into this column).
++ */
++ metrics.gmptGlyphOrigin.x -= 1;
++ metrics.gmBlackBoxX += 3;
++ }
+ }
+ cairo_win32_scaled_font_done_font (&scaled_font->base);
+ if (status)