[cairo] Success with Cairo on Win9x

Behdad Esfahbod behdad at behdad.org
Fri Feb 9 13:51:43 PST 2007


On Fri, 2007-02-09 at 12:52 -0700, Brian Palmer wrote:
> >How do you use the font APIs?  Do they work?
> 
> Yes, they work just fine. This is the code I used to create a FreeType font:
> 
> 	FT_Error	error;
> 
> 	m_pFreeTypeLibrary = new FT_Library;
> 	error = FT_Init_FreeType(((FT_Library*)m_pFreeTypeLibrary));
> 
> 	if (error)
> 	{
> 		delete ((FT_Library*)m_pFreeTypeLibrary);
> 		m_pFreeTypeLibrary = NULL;
> 		return;
> 	}
> 
> 	m_pFreeTypeFace = new FT_Face;
> 	error = FT_New_Face(*((FT_Library*)m_pFreeTypeLibrary),
> strFontFilePath, 0, ((FT_Face*)m_pFreeTypeFace));
> 
> 	if (error)
> 	{
> 		delete ((FT_Face*)m_pFreeTypeFace);
> 		m_pFreeTypeFace = NULL;
> 		FT_Done_FreeType(*((FT_Library*)m_pFreeTypeLibrary));
> 		delete ((FT_Library*)m_pFreeTypeLibrary);
> 		m_pFreeTypeLibrary = NULL;
> 		return;
> 	}
> 
> 	m_pCairoFontFace =
> cairo_ft_font_face_create_for_ft_face(*((FT_Face*)m_pFreeTypeFace), 0); 
> 
> 
> 
> Then I create a scaled font from that and call cairo_text_path() on a string
> and then stroke the path.
> 
> 
> 
> 
> >>So what do you think about getting a separate cairo feature #define for 
> >>fontconfig?
> 
> >Can you show us a patch?
> 
> Would it be okay to just send you the entire file? Or can you give me
> instructions on how to generate a suitable patch? The file is just the plain
> v1.3.10 cairo-ft-font.c file with the fontconfig code commented out. I
> believe I also had to comment out the _cairo_ft_scaled_font_create_toy()
> function and NULL it's pointer in the backend because that function uses
> fontconfig stuff extensively. 

Sure, just send the entire file to the list.   What you are doing is
exactly what I thought.  While using cairo with FreeType only can be
useful, it's use is seriously limited without fontconfig.  For example
the toy text API will not work, nor will Pango.  So, while we may enable
such builds, users should really think about getting fontconfig.  Is
there any reason that fontconfig cannot be built on Win9x?


-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list