summaryrefslogtreecommitdiff
path: root/pango/pangofc-private.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2010-09-21 15:47:17 -0400
committerBehdad Esfahbod <behdad@behdad.org>2010-09-21 15:49:07 -0400
commit64ada662476f5b5506a9a455f4c39242ab51ff38 (patch)
treee823ef001fb95198ba0fea2944db8334daef4942 /pango/pangofc-private.h
parente008ca8f198965b55fc4ef297b4d31902b5afc36 (diff)
parent254f42980e272f0560b28d466c2b65a1748b1132 (diff)
downloadpango-64ada662476f5b5506a9a455f4c39242ab51ff38.tar.gz
Merge branch 'master' into harfbuzz-ng-external
Conflicts: pango/Makefile.am pango/pango-ot-buffer.c pango/pango-ot-info.c Removed: pango/opentype/Makefile.am pango/opentype/hb-blob.c pango/opentype/hb-open-file-private.hh pango/opentype/hb-open-type-private.hh pango/opentype/hb-ot-layout-common-private.hh pango/opentype/hb-ot-layout-gdef-private.hh pango/opentype/hb-ot-layout-gpos-private.hh pango/opentype/hb-ot-layout-gsub-private.hh pango/opentype/hb-ot-layout-gsubgpos-private.hh pango/opentype/hb-ot-layout.cc pango/opentype/hb-ot-layout.h pango/opentype/hb-private.h
Diffstat (limited to 'pango/pangofc-private.h')
-rw-r--r--pango/pangofc-private.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h
index b5fab578..7945962e 100644
--- a/pango/pangofc-private.h
+++ b/pango/pangofc-private.h
@@ -91,8 +91,52 @@ void pango_fc_font_get_raw_extents (PangoFcFont *font,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
-PangoFontMetrics *pango_fc_font_create_metrics_for_context (PangoFcFont *font,
- PangoContext *context);
+PangoFontMetrics *pango_fc_font_create_base_metrics_for_context (PangoFcFont *font,
+ PangoContext *context);
+
+
+
+/* To be made public at some point */
+
+#include <math.h>
+
+static G_GNUC_UNUSED void
+pango_matrix_get_font_scale_factors (const PangoMatrix *matrix,
+ double *xscale, double *yscale)
+{
+/*
+ * Based on cairo-matrix.c:_cairo_matrix_compute_scale_factors()
+ *
+ * Copyright 2005, Keith Packard
+ */
+ double major = 0, minor = 0;
+
+ if (matrix) {
+ double det = matrix->xx * matrix->yy - matrix->yx * matrix->xy;
+
+ if (det)
+ {
+ double x = matrix->xx;
+ double y = matrix->yx;
+
+ major = sqrt (x*x + y*y);
+
+ /*
+ * ignore mirroring
+ */
+ if (det < 0)
+ det = - det;
+
+ if (major)
+ minor = det / major;
+ }
+ }
+
+ if (xscale)
+ *xscale = major;
+ if (yscale)
+ *yscale = minor;
+}
G_END_DECLS