Hi,

When using the cairo-ext under Windows I get a lot of warnings about the font not being found and the font size looks bad. The attached patch fixes that problem, tested under Debian Squeeze and Windows.

Regards,
Mark de Wever

diff --git a/drivers/cairo.c b/drivers/cairo.c
index f3be69e..c1a45ea 100644
--- a/drivers/cairo.c
+++ b/drivers/cairo.c
@@ -957,7 +957,9 @@ void open_span_tag( char *pangoMarkupString, PLUNICODE fci, 
float fontSize, int
     plP_fci2hex( fci, &fontFamily, PL_FCI_FAMILY );
     plP_fci2hex( fci, &fontStyle, PL_FCI_STYLE );
     plP_fci2hex( fci, &fontWeight, PL_FCI_WEIGHT );
-    snprintf( openTag, TAG_LEN, "<span font_desc=\"%s %.2f\" ", 
familyLookup[fontFamily], fontSize );
+    /* From 
http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html
+     * size = font size in 1024ths of a point. */
+    snprintf( openTag, TAG_LEN, "<span font_desc=\"%s\" size=\"%d\" ", 
familyLookup[fontFamily], (int)( fontSize * 1024. ) );
     strncat( pangoMarkupString, openTag, MAX_MARKUP_LEN - 1 - strlen( 
pangoMarkupString ) );
 
     snprintf( openTag, TAG_LEN, "style=\"%s\" ", styleLookup[fontStyle] );
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to