+wxCairoFontData::wxCairoFontData(wxGraphicsRenderer* renderer,
+ double sizeInPixels,
+ const wxString& facename,
+ int flags,
+ const wxColour& col) :
+ wxGraphicsObjectRefData(renderer)
+{
+ InitColour(col);
+
+ // Resolution for Cairo image surfaces is 72 DPI meaning that the sizes in
+ // points and pixels are identical, so we can just pass the size in pixels
+ // directly to cairo_set_font_size().
+ m_size = sizeInPixels;
+
+#if defined(__WXGTK__) || defined(__WXMAC__)
+ m_font = NULL;
+#endif
+
+ // There is no need to set m_underlined under wxGTK in this case, it can
+ // only be used if m_font != NULL.
+
+ InitFontComponents
+ (
+ facename,
+ flags & wxFONTFLAG_ITALIC ? CAIRO_FONT_SLANT_ITALIC
+ : CAIRO_FONT_SLANT_NORMAL,
+ flags & wxFONTFLAG_BOLD ? CAIRO_FONT_WEIGHT_BOLD
+ : CAIRO_FONT_WEIGHT_NORMAL
+ );
+}
+