Problem loading font face using freetype and cairo

This is a discussion on Problem loading font face using freetype and cairo within the C Programming forums, part of the General Programming Boards category; I have been using cairo quite nicely but have grown tired of the toy fonts. I am trying to load ...

  1. #1
    Registered User javaeyes's Avatar
    Join Date
    Feb 2012
    Posts
    153

    Problem loading font face using freetype and cairo

    I have been using cairo quite nicely but have grown tired of the toy fonts. I am trying to load a font face into a cairo_font_face_t struct. But am having a little problem:
    Code:
    FT_Library library;
    FT_Face face;
    FT_Init_FreeType( &library );
    FT_New_Face( library, "/usr/share/fonts/truetype/ttf-scriptin/SCRIPTIN.ttf", 0, &face );
    cairo_font_face_t *myfont_face;
    myfont_face =  cairo_ft_font_face_create_for_ft_face(face,0); // THIS LINE THROWING ERROR -
    Compiler: warning: assignment makes pointer from integer without a cast
    Any help greatly appreciated. It's possible I don't need to be using a cairo_font_face_t at all, but I think I do. Thank you.

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    The compiler seems to be assuming that cairo_ft_font_face_create_for_ft_face returns an int. Have you forgotten an include file?

  3. #3
    Registered User javaeyes's Avatar
    Join Date
    Feb 2012
    Posts
    153
    Thank you!!! Needed to include cairo-ft.h, It's typical, spend 7 hours banging your head and all you need is one line of code. Cheers!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cairo and GTK, still need a pixmap?
    By TriKri in forum Linux Programming
    Replies: 0
    Last Post: 03-18-2008, 04:18 PM
  2. stdafx.h and the FreeType library
    By Mastadex in forum Windows Programming
    Replies: 1
    Last Post: 11-23-2007, 12:36 PM
  3. How to know the name of the font face of an edit control?
    By Joelito in forum Windows Programming
    Replies: 3
    Last Post: 12-22-2006, 06:54 PM
  4. Replies: 1
    Last Post: 01-24-2005, 01:07 PM
  5. Changing Font Face!!
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 07-26-2002, 06:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21