summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pango/pangofc-font.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 77e99e16..03f15efa 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -77,6 +77,7 @@ static void _pango_fc_font_get_scale_factors (PangoFont *fon
double *y_scale);
static void pango_fc_font_get_matrix (PangoFont *font,
PangoMatrix *matrix);
+static int pango_fc_font_get_absolute_size (PangoFont *font);
#define PANGO_FC_FONT_LOCK_FACE(font) (PANGO_FC_FONT_GET_CLASS (font)->lock_face (font))
#define PANGO_FC_FONT_UNLOCK_FACE(font) (PANGO_FC_FONT_GET_CLASS (font)->unlock_face (font))
@@ -112,6 +113,7 @@ pango_fc_font_class_init (PangoFcFontClass *class)
pclass->is_hinted = _pango_fc_font_is_hinted;
pclass->get_scale_factors = _pango_fc_font_get_scale_factors;
pclass->get_matrix = pango_fc_font_get_matrix;
+ pclass->get_absolute_size = pango_fc_font_get_absolute_size;
/**
* PangoFcFont:pattern:
@@ -300,6 +302,18 @@ pango_fc_font_describe_absolute (PangoFont *font)
return desc;
}
+static int
+pango_fc_font_get_absolute_size (PangoFont *font)
+{
+ PangoFcFont *fcfont = (PangoFcFont *)font;
+ double size;
+
+ if (FcPatternGetDouble (fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
+ return (int) (size * PANGO_SCALE);
+
+ return 0;
+}
+
static PangoCoverage *
pango_fc_font_get_coverage (PangoFont *font,
PangoLanguage *language G_GNUC_UNUSED)