[Sugar-devel] installing a font?

Bert Freudenberg bert at freudenbergs.de
Mon Oct 31 11:08:29 EDT 2011


On 26.10.2011, at 23:43, Erik Blankinship wrote:

> Is there a way for an xo bundle to install a font to the system (for cairo to use)?

No, and it shouldn't, since activities need to be self-contained.

If your activity wants to use that font, then just use the font file directly from your activity bundle, like in a "fonts" subdirectory.

E.g., in FreeType you can just give a full path to a font file:
http://www.freetype.org/freetype2/docs/tutorial/step1.html

So FT_New_Face() would create a face from a file, and then cairo_ft_font_face_create_for_ft_face() creates a corresponding Cairo font face:
http://cairographics.org/manual/cairo-FreeType-Fonts.html

Similarly, cairo_ft_font_face_create_for_pattern() seems to allow making a face from a FC_FILE pattern.

HTH,

- Bert -



More information about the Sugar-devel mailing list