summaryrefslogtreecommitdiff
path: root/pango/pangocoretext-fontmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pangocoretext-fontmap.c')
-rw-r--r--pango/pangocoretext-fontmap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c
index 0980303b..3d8544c6 100644
--- a/pango/pangocoretext-fontmap.c
+++ b/pango/pangocoretext-fontmap.c
@@ -407,6 +407,8 @@ _pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef d
char *family_name;
char *style_name;
PangoFontDescription *font_desc;
+ CFNumberRef cf_number;
+ CGFloat pointsize;
font_desc = pango_font_description_new ();
@@ -419,6 +421,11 @@ _pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef d
pango_font_description_set_family (font_desc, family_name);
g_free (family_name);
+ /* Size (if we have one) */
+ cf_number = CTFontDescriptorCopyAttribute (desc, kCTFontSizeAttribute);
+ if (cf_number != NULL && CFNumberGetValue (cf_number, kCFNumberCGFloatType, &pointsize))
+ pango_font_description_set_size (font_desc, (pointsize / (96./72.)) * 1024);
+
/* Weight */
pango_font_description_set_weight (font_desc,
ct_font_descriptor_get_weight (desc));