2008-03-05 08:45:09 +03:00
|
|
|
diff --git a/gfx/cairo/cairo/src/cairo-ft-font.c b/gfx/cairo/cairo/src/cairo-ft-font.c
|
|
|
|
--- a/gfx/cairo/cairo/src/cairo-ft-font.c
|
|
|
|
+++ b/gfx/cairo/cairo/src/cairo-ft-font.c
|
|
|
|
@@ -63,6 +63,10 @@
|
|
|
|
/* This is the max number of FT_face objects we keep open at once
|
2006-11-29 23:19:35 +03:00
|
|
|
*/
|
|
|
|
#define MAX_OPEN_FACES 10
|
2008-03-05 08:45:09 +03:00
|
|
|
+
|
2006-11-29 23:19:35 +03:00
|
|
|
+/* This is the maximum font size we allow to be passed to FT_Set_Char_Size
|
|
|
|
+ */
|
|
|
|
+#define MAX_FONT_SIZE 1000
|
2008-03-05 08:45:09 +03:00
|
|
|
|
2006-11-29 23:19:35 +03:00
|
|
|
/*
|
|
|
|
* The simple 2x2 matrix is converted into separate scale and shape
|
2008-03-05 08:45:09 +03:00
|
|
|
@@ -682,9 +686,11 @@ _cairo_ft_unscaled_font_set_scale (cairo
|
2006-11-29 23:19:35 +03:00
|
|
|
FT_Set_Transform(unscaled->face, &mat, NULL);
|
|
|
|
|
|
|
|
if ((unscaled->face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) {
|
2008-03-05 08:45:09 +03:00
|
|
|
+ double x_scale = MIN(sf.x_scale, MAX_FONT_SIZE);
|
|
|
|
+ double y_scale = MIN(sf.y_scale, MAX_FONT_SIZE);
|
2006-11-29 23:19:35 +03:00
|
|
|
error = FT_Set_Char_Size (unscaled->face,
|
2008-03-05 08:45:09 +03:00
|
|
|
- sf.x_scale * 64.0 + .5,
|
|
|
|
- sf.y_scale * 64.0 + .5,
|
|
|
|
+ x_scale * 64.0 + .5,
|
|
|
|
+ y_scale * 64.0 + .5,
|
2006-11-29 23:19:35 +03:00
|
|
|
0, 0);
|
2008-03-05 08:45:09 +03:00
|
|
|
if (error)
|
|
|
|
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|