[cairo] Success with Cairo on Win9x

Brian Palmer brianp at sginet.com
Fri Feb 9 11:52:52 PST 2007


>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. 



More information about the cairo mailing list