summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2018-10-21 13:36:46 +1030
committerAdrian Johnson <ajohnson@redneon.com>2018-10-21 13:42:24 +1030
commit717f0e0a40b8d947dad3fb9f25c3aad1619aae87 (patch)
treead4d5244ea2be5e1aeafa57c630cbcf68c0b59cf
parentec70bde74ab2fb7fa4a9d648c9d7367b7daf59c2 (diff)
type1: fallback if the font matrix is not a uniform scale
https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/1790242
-rw-r--r--src/cairo-type1-subset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c
index 5f0745688..754c32395 100644
--- a/src/cairo-type1-subset.c
+++ b/src/cairo-type1-subset.c
@@ -388,6 +388,11 @@ cairo_type1_font_subset_get_bbox (cairo_type1_font_subset_t *font)
/* Freetype uses 1/yy to get units per EM */
font->base.units_per_em = 1.0/yy;
+ /* If the FontMatrix is not a uniform scale the metrics we extract
+ * from the font won't match what FreeType returns */
+ if (xx != yy || yx != 0.0 || xy != 0.0)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
font->base.x_min = x_min / font->base.units_per_em;
font->base.y_min = y_min / font->base.units_per_em;
font->base.x_max = x_max / font->base.units_per_em;