About FcFreeTypeQueryFace()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am new to FontConfig. I have a FT_Face and I want to get the
filename and font index from it. I found FcFreeTypeQueryFace() should
be useful. However, what should I put in the second and third
argument? I don't quite understand what is mean by "used solely as
data for pattern elements" as mentioned in the man page. I tried to
put NULL and zero but the call fails. If I put something non-zero, the
call success:

// something non-null
FcChar8 abc[1] ;

FcBlanks *b = FcBlanksCreate() ;
FcPattern *p = FcFreeTypeQueryFace( face, abc, 0, b ) ;
		
FcChar8 *filename2 ;
FcResult result ;
FcPattern *matched = FcFontMatch( 0, p, &result);

if (FcPatternGetString (matched, FC_FILE, 0, &filename2) != FcResultMatch)
	std::cout << "oops" << std::endl ;

int id ;
if (FcPatternGetInteger (matched, FC_INDEX, 0, &id) != FcResultMatch)
	std::cout << "oops2" << std::endl ;
		
std::cout << "file is " << filename2 << " " << id << std::endl ;

It actually works. I want to ask if it is OK to put some dummy
non-null pointer to the function?

Thanks in advance.

Nestal
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux