[cairo] n00b problems: can't get non-default fonts to work...

Philip Schneider philip at pixologic.com
Thu Mar 7 13:36:20 PST 2013

Greetings -

Background info: I have an interactive cross-platform application written in C++. For general development/debugging on the desktop, it uses Qt. For Flash, I'm using Adobe's FlasCC to compile C/C++ into Actionscript byte code. Recently, I added pixman and cairo into the mix, and all is well in the Qt version.  What basic drawing commands I've tried seem to work just fine: I'm using cairo_image_surface_create_for_data()  to  provide cairo with an in-memory pixmap for rendering, and then using the results as a texture, for display (this is in both the Qt version, and the Flash version).

I've ported pixman and cairo to FlasCC, and built with freetype support. I've used "./configure" to set up the config.h and cairo-features.h, etc. Those files look reasonable, although it must be said that some of the operations in "configure" fail (creating test programs on the fly presumes you can make command-line-executables with gcc, and with Flash's gcc, this is not possible).

I've tried using cairo_select_font_face() and cairo_show_text() to test-render some simple text. In the Qt version, the font family I specify as an argument has the intended effect: different font specifiers result in different fonts being used to render the text. However, in the Flash version, I get only what appears to be the cairo built-in/fallback font (some flavor of sans-serif), irrespective of what font is requested. In addition, with that built-in font, the visual appearance in the Flash version is quite a bit less nice than the same font at the same size in the desktop version -  the glyphs look almost unreadably blurry...

My assumption is that I've done something wrong with the configure step of building Cairo (or perhaps, less likely, pixman), or something similar. For various reasons, I'm unable to run the Flash program in the debugger, and so I cannot trace through the code to see what's happening. It's possible to use "printf debugging", but of course this is exceedingly tedious and inefficient...

Any advice on what might have gone wrong would be greatly appreciated! 


-- Philip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130307/1156bef6/attachment.html>

More information about the cairo mailing list