gfx/cairo/max-font-size.patch

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 diff --git a/gfx/cairo/cairo/src/cairo-ft-font.c b/gfx/cairo/cairo/src/cairo-ft-font.c
michael@0 2 --- a/gfx/cairo/cairo/src/cairo-ft-font.c
michael@0 3 +++ b/gfx/cairo/cairo/src/cairo-ft-font.c
michael@0 4 @@ -63,6 +63,10 @@
michael@0 5 /* This is the max number of FT_face objects we keep open at once
michael@0 6 */
michael@0 7 #define MAX_OPEN_FACES 10
michael@0 8 +
michael@0 9 +/* This is the maximum font size we allow to be passed to FT_Set_Char_Size
michael@0 10 + */
michael@0 11 +#define MAX_FONT_SIZE 1000
michael@0 12
michael@0 13 /*
michael@0 14 * The simple 2x2 matrix is converted into separate scale and shape
michael@0 15 @@ -682,9 +686,11 @@ _cairo_ft_unscaled_font_set_scale (cairo
michael@0 16 FT_Set_Transform(unscaled->face, &mat, NULL);
michael@0 17
michael@0 18 if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) {
michael@0 19 + double x_scale = MIN(sf.x_scale, MAX_FONT_SIZE);
michael@0 20 + double y_scale = MIN(sf.y_scale, MAX_FONT_SIZE);
michael@0 21 error = FT_Set_Char_Size (unscaled->face,
michael@0 22 - sf.x_scale * 64.0 + .5,
michael@0 23 - sf.y_scale * 64.0 + .5,
michael@0 24 + x_scale * 64.0 + .5,
michael@0 25 + y_scale * 64.0 + .5,
michael@0 26 0, 0);
michael@0 27 if (error)
michael@0 28 return _cairo_error (CAIRO_STATUS_NO_MEMORY);

mercurial